Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Is there a way to recover contents of a bad USB Flash Drive?

I know something has gone wrong when you get asked to format the stick when you plug it in.

share|improve this question

3 Answers 3

On windows try the Hewlett Packard USB Key formating utility:

h20000.www2.hp.com/bizsupport/TechSupport/SoftwareDescription.jsp?lang=en&cc=us&swItem=MTX-UNITY-I23839&jumpid=reg_R1002_USEN

You could also try any one of dozens of recovery tools to read files off corrupt flash drives.

This one's freeware: www.fileguru.com/Smart-Flash-Recovery/info

You'll have to manually copy those links and add the http stuff @ the beginning as I'm a newb here & not allowed to insert links properly.

share|improve this answer

It depends if it is a physical or hardware failure.

Chances are it was a USB glitch that messed up the Partition Table. I have had that happen a few times with USB drives; really ticks me off.

I have had success with TestDisk - www.cgsecurity.org/wiki/TestDisk

It may be able to find and recover the partition table and/or FAT/MFT.

If that doesn't work try other file based recovery tools like File Scavenger.

share|improve this answer

(Commands posted here work on UNIX systems as that's how I solve most of these types of problems)

Before doing much, I would make a copy of the current state of the Flash drive:

$ cat /dev/sdc > drivedump or: $ dd if=/dev/sdc of=drivedump bs=4k conv=noerror

Substitute sdc with the address of your drive. You can try to figure out what it should be by putting it in, and typing:

$ dmesg | less

And seeing what was created at the end. Should be /dev/sd and is probably the lowest letter that exists.

If the memory is going bad, you want to get everything off of it ASAP before it gets worse. If not, a copy won't hurt when you run tools on it.

Now that you have a copy of the drive, you have to figure out what got mangled. You can see if fdisk has some idea what the partition looked like:

/sbin/fdisk -l drivedump

If it gets very confused, you have a partition failure of some kind: you have to rebuild the partition table of the file. If it knows exactly what's up and it all looks right (one partition, and it's the size of the stick) then you can try mounting it to see if it works. If you're missing tons of files after mounting it, you can run any of the usual suspects of file recovery tools. I don't know what they are, but someone else can help with that :)

Make copies of that dump every time you mess with it... you don't want a tool to hose your only copy.

share|improve this answer
    
I find a sudo fdisk -l will usually list the drive without having to search through dmesg, and fsck can repair a feew problems too, but I don't know whether it can be used on a drive dump file. –  Andy May 28 '09 at 6:20
1  
Additionally, if the original poster doesn't have access to a unix variant, he can download either pendrive linux or portable ubuntu, and run that within Windows without having to reboot –  Andy May 28 '09 at 6:33

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.