del.icio.us .:. stumble .:. digg

Easy Flash Drive Data Recovery with PhotoRec .:. kentbrewster.com

Had a bit of trouble today: one of Vickie's two-gig thumb drives went catatonic. All Windows could come up with was the scary message that the disk in drive E wasn't formatted, and did she want to format it now? (Answer: nooooooo!) After a bit of investigation--the usual stuff: reboot, pray, try it on several machines, sacrifice a chicken--we came to the conclusion that the thing's file system had broken.

So, armed with foggy memories of how Norton Utilities used to work, off I went into the wilds of the Net, searching for recovery advice. Mostly I found questionable stuff; there are many operators out there who will charge you hundreds of dollars to take a crack at your data with no guarantees, and there are plenty of freeware/shareware downloads that claim to recover lost files but were last updated in 1997, and have since been turned into those $49.95 bloatware packages you see at Office Depot. Most of these are about hard drives or floppy disks, not memory sticks; I tried a half-dozen, but got nothing back from Vickie's poor dead baby.

Finally I found Christophe Grenier's TestDisk/PhotoRec suite, at http://cgsecurity.org. PhotoRec ignores the file system in favor of finding lost files, so it works on FAT, NTFS, EXT2/EXT3, HFS, and (with certain caveats) ReiserFS. And since it's looking for known file headers and using data carving techniques, more than eighty file types--among them DOC, PDF, and PPT--are instantly recoverable. Here's how it went:

  • I downloaded the ZIP file, extracted it to my desktop--no installation required, awesome!--and fired up PhotoRec. After smiling at the text-only interface, I hit the down-arrow to highlight the drive--in my case it was /dev/sdb--and hit Enter to continue.
  • Next I needed to choose the partition table type. Not knowing what else to do, I chose Intel, since the last time the thing had run successfully was on a Windows machine. (I'm guessing this would want to be set to Macintosh if one was attempting recovery from a Mac-formatted iPod.)
  • The next screen showed an empty partition and a FAT16 partition, both of which took up pretty much the entire disk. I crossed my fingers and hit Enter again, choosing the empty partition.
  • Next, it asked me to choose my filesystem; I was pretty sure we weren't looking at an EXT2/EXT3 system, so I hit Enter to accept Other, the highlighted default.
  • Finally it asked for a location to store recovered data; I went again with the default, which creates a new directory wherever you have the program installed. And we were off and running; the first file to pop up was a PDF, and since my new directory showed thumbnails by default, I could see that everything was going to be okay. Four minutes later, we were all done; all Vickie had to do was re-create her directory structure, re-name her files, and figure out which belonged where.
  • Many thanks, Christophe; you ought to be receiving one of your US Amazon wish-list items from us shortly.

    Post a Comment

    Jim .:. 2009-06-01 08:33:14
    Figured I would try this out. Have a new 16GB USB Flash Drive that I was moving files to when my computer locked up due to spyware. Had to hard shut down PC and since then, Windows Explorer can see the drive when insterted but prompts "Please insert a disk in drive G:" when it is clicked on. Files that existed on the drive cannot be seen. Properties of G; drive show it as a "Removable Disk", File System: "Unknown" and 0 bytes of used or free space. When runnning either TestDisk or PhotoRec they only see my HDD. No Flash Drive is recognized. It appears I need to do something different. Any input or ideas are welcome! Thanks.
    Michael .:. 2009-05-27 11:49:45
    Thanks so much for this suggestion. I'm in the process of getting back 3 years worth of pictures that were deleted by system recovery process (an accident). I used PhotoRec. I'll attempt to use TestDisk to see if I can get the files with the original name.
    Dinesh Thapa .:. 2009-05-24 03:13:02
    Excellent program. Thanks god I recovered very important pictures of my research experiment
    kevyshaun .:. 2009-03-12 13:20:42
    This finds files that arent in the same order that they were on the4 usb flash drive that I was trying to do a recovery with PhotoRec restoring files but without the original names, and in a serial sequence. Is there a way to recover them the same way as they were on the disk that you are trying to recover tyhem from. Makes it veryu hard to know what files belong together.

    Thanks
    KJ .:. 2009-02-22 19:19:23
    my USB doesn't work on any computers, it doesn't light up or show up in My Computer
    i downloaded PhotoRec, but i can't find my USB, it's usually under Removable Disk L:
    only my HD was in the list of options
    I don't know what to do, can someone help me?
    ObsidianGT .:. 2008-12-04 13:07:47
    UPDATE!: I found that because the partition was actually deleted, I had to choose "None" as the partition table type when asked. Once I picked that, it was able to pull up the file structure. It showed the files as they were when the partition was deleted, and older deleted files were marked in red. It was a simple keystroke to restore a file. Amazing!!

    PhotoRec restored files but without the original names, and in a serial sequence. It also was unable to tell older deleted files apart from the current files as of the partition wipe. Both are excellent tools, however. It's just a matter what situation to apply each one to.
    ObsidianGT .:. 2008-12-04 12:32:45
    I used PhotoRec with great success. I was even more shocked to learn that it's under GNU/GPL licensing. TestDrive unfortunately was unable to find my partition (it was JUST accidentally deleted during Windows XP text setup), but at least the actual files were recovered by PhotoRec. I sent the author a few Euros to thank him.
    Kent Brewster .:. 2008-10-29 09:08:47
    Hmm ... that's perilously close to spam, Chris. I'm going to leave it for now, just in case somebody hits a wall with PhotoRec and needs help.

    Folks, remember to do your back-ups, and to try free solutions first and send the authors your support if they work.
    Chris P .:. 2008-10-29 05:53:43
    Excellent article. I’ve now had 2 flash drives die on me and each time I let myself lapse into a false sense of security, by not making regular backups of the data. I recently read an article in the news about discarded flash drives and hard drives contained in old PC’s that people just throw away, and the subsequent data protection issues this creates. Most people would rightfully just format the hard drive or flash drive and dump it thinking that they had done enough, when in actual fact this data is often recoverable. I work for a company that works in this kind of area, recovering data from, promotional usb drives, memory cards and hard drives. There's not always a certainty of getting your data back, but often a very good chance!
    Jack .:. 2008-09-04 03:08:17
    Very nice and informative article. I have recentaly face the problem of data loss. I have used Stellar data recovery software to recover my data.I do not know much about the process of data recovery but through the software I am able to recover the data very easily. Software GUI interface makes recovery very easy.
    Alex Krenvalk .:. 2008-03-17 05:38:17
    On as regards flash drive data recovery i know little,but for restore zip files,use-zip file recovery,application is the fact that it employs several heuristic algorithms and methods to repair zip file or recover information from damaged zip files, use of multiple algorithms allows the program to minimize data loss during zip recovery, therefore the user sees as much as possible about the files being recovered,will have to enter the password when prompted and the application will make a fix zip file attempt using the specified password,program supports Windows 98, Windows Me, Windows NT 4.0, Windows 2000, Windows XP, Windows XP SP2, Windows 2003 and Windows Vista.

Copyright Kent Brewster 1987-2009 .:. FAQ .:. RSS .:. Contact