How can I restore the contents of my USB Key?

I have a USB Key that was formatted by Windows XP with a Fat32 file system. During the SUSE install, the partitions were accidently erased from the USB Key, but I don’t believe the USB Key was formatted. How can I restore the content of my USB Key?

Have you tried using file restoration utilities? Just google them.

But since the partition is lost… I am highly doubtful that you will be able to restore the content.

If it was not formatted, and if you can recreate the exact same partition table, you might just be surprised to find the files are still there - of course re-creating the same partition table it had before is not that easy.

You could try a utility such as foremost - it does not matter if it is missing a partition table, or if files have been deleted or the partition formatted. Foremost operates independently of the file system - it is a file carving tool. It will look for the headers and footers of know file types and attempt to recover the data between these points. Some times it recovers extremely well, others not so much.

I have run this on reformatted partitions, or just on an active /home partition, and discovered thousands of recoverable files.

It takes a bit of playing around with it to get it to work, but there are several good on line tutorials.

One thing I noticed is that you have to actually specify the conf file to use, even if it is the default on it /etc/formost.conf (or whatever) - don’t expect it to find and use it by default.

However, I might suggest you first off make an image of the stick before you do anything else. Even though it is “blank” you can still image the data structures and then run the recovery on the image. I have imaged entire drives and run foremost on the image. To image just use: #dd if=/dev/sda of=my.image (replacing sda with the appropriate drive designation. Note you use the entire block device, you don’t specify a partition.) Then run foremost on my.image

You can install foremost, or use a LiveCD like Backtrack, SystemRescueCD or Helix.

You could also play around with Autopsy and Sleuthkit which will perform a similar analysis and show files which can be “undeleted” from a device, even lacking a partition table.

I bet though that foremost will do a pretty good job.

Let us know how it goes!

Cheers,
Pete Eby

Wow. Never thought that such thing is possible.

I wonder how big his USB is though… big enough to be worth making a partition… ****.