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.
On windows try the Hewlett Packard USB Key formating utility:
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.
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.
(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.