Thursday, January 20, 2011

In FreeBSD 8 how can I recover a deleted slice/partition on a flash disk?

I accidentally deleted the primary partition on my USB flash disk.

Is there a way of undoing that? I can't even seem to see the drive anymore in windows? It's not available in the disk utility.

If I can even format it again (as msdosfs) that would be great.

  • If you don't care about the data, re-run the FreeBSD installer, select a "custom" installation type, select option 3 ("Partition") and create a new partition (you can press A to have the partitioning tool grab the whole disk, then just change the type to something Windows will like (7 = NTFS) and Windows should be able to see it & format it).
    Remember to write the new partition table (W) before exiting.
    Obviously be extra careful, since a mistake here (like selecting the wrong drive to re-partition) could really ruin your whole day...

    Obviously you should be able to do the same thing with the Windows partitioning tools (but I don't have any of those handy).


    If you want to actually get your data back the answer is somewhat more involved (You'd need to re-create the partition table as it was before, which presupposes you know the old layout. If not you start getting into disk exploration or recovery tools).

    Matt : Ok, so the windows PC didn't see my flash disk because the USB port on the front of the computer (not my normal one) doesn't work. Plugged it into the back and it's fine. Your procedure also works.
    voretaq7 : Yeah, a dead USB port would make the system not recognize the flash disk :-) Out of curiousity have you ever tried a thumb drive with a scrambled partition table on a Windows host? Curious how it reacts...
    From voretaq7

0 comments:

Post a Comment