
Has your wife ever deleted photos from her camera and begged you to recover them? (Mine did!) Did you accidentally delete a movie off of your hard disk that you really wanted to watch? Thanks to some wonderful open-source software named PhotoRec, it’s really easy to recover your data. It’s available for free for Windows, Mac OS X, and most UNIX flavors. PhotoRec is a command-line utility, but also surprisingly user-friendly.
Installing PhotoRec
I’m running Linux Mint 7 as my home desktop operating-system, so I use apt-get to install it (as with Debian or Ubuntu Linux) so that I get automatic updates in the future. If you are running something else, just download it using the website. PhotoRec is part of the testdisk package:
% sudo apt-get install testdisk
Starting PhotoRec
This is the easiest part:
% photorec
Technically, it requires root/administrator access, but if it is launched without, it will ask to restart using sudo, which I found extremely user-friendly.
Using PhotoRec
PhotoRec has lots of options, but you are usually safe just going with the default if you don’t understand what you are doing. I’ll walk you through the steps and explain what each screen has, and why you may want to change the default. The first screen asks for which drive you would like to recover. I knew mine was a 4GB (~4096MB) SD card, which shows up as a Generic Storage Device:
Now you have to select what type of partition table the disk has. 98% of people out there are going to be using the default Intel partition table format. An exception might be if you are trying to recover files off of a corrupt Mac OS X drive:
Now you need to choose between selecting the entire disk, or just a partition of it. Like most disks, my card only has one partition, so I just went with the default value of partition 1. In my case, it was listed as a FAT32 partition, the standard that most CompactFlash and SD cards are formatted with.
The next step asks what type of filesystem type you are expecting the data to be in. This may seem redundant with the previous step, but it is possible that you had a FAT32 partition that you accidentally changed to a EXT3 (Linux) partition type. Most people should just go with the default choice here, oddly named “Other”:
Phew, that’s a lot of screens we had to cover. Now, we have one more trick question:
Do we want to recover from the “Free” space or the Whole partition? By free, photorec means “Deleted files”, rather than intact and properly allocated files. Like most people, I wanted to only recover from the “Free” (deleted) space only. Now for the final screen, which is a text-based directory browser that allows you to select what directory to save the recoverd files onto. I just hit “Y” to go with the default of dumping the photos onto my desktop:
The output
For each directory on the SD card that it found deleted photos in, PhotoRec created a “recup_dir.X” directory on my desktop. As you can see, it was quite successful in finding photos from our trip through Austria:
All told, it recovered over 1000 photos from the SD card, most of which we didn’t actually need. It’s the thought that counts!







Add New Comment
Viewing 2 Comments
Thanks. Your comment is awaiting approval by a moderator.
Do you already have an account? Log in and claim this comment.
Do you already have an account? Log in and claim this comment.
Do you already have an account? Log in and claim this comment.
Add New Comment
Trackbacks
(Trackback URL)