Wednesday, May 9, 2007

Data Recovery with (free) PhotoRec in OS X

Imagine my horror when I went to process the photos on my memory card only to find that they were gone. And these weren't just any photos, but rather a day's worth of before and after photos of patients (in my real life, I'm a facial plastic surgeon).

Now, "after" photos are one thing...patients could always come back for more picture-taking, even though many come from hours away. But "before" photos on patients treated later that same day can never be re-shot, of course. So due to what I suspect was corruption of the directory structure, only the previous day's images were on the card.

Now, since I had reviewed the photos on the camera back when I shot them, I suspected that the data was still there, just inaccessible through either the camera's interface or my computer's OS. So I started scrounging the web for memory card photo recovery utilities when I came across a little gem called "PhotoRec"..and it was freeware!

Sure, I found a freeware app called "EXIF Untrasher," but it only recovered JPEGs, and I shoot in RAW. And there were a few nice shareware and commercial apps like "PhotoRescue" ($29.00) and "CardRaider" ($19.95) that can recover RAW, but I wanted something FREE and PhotoRec fit the bill.

Now, granted, the pay apps have nice GUIs while PhotoRec runs in the UNIX shell in a text-based interface, but it requires little interaction and gets the job done. It also runs on just about any common OS platform from Mac OS X to Windows to Linux to Solaris, etc. Most importantly, it also recovered the entire card of RAW files including some I thought I'd gotten rid of ages ago.

Here are the simple steps to running this under Mac OS X (FWIW, photos on the card were shot in Canon RAW and camera's CF card was mounted via a card reader under Mac OS X 10.4.9):

(1) Download PhotoRec v6.6 here. Don't worry that it's also a download for an app called TestDisk, which I haven't played with (yet).

(2) Uncompress the file testdisk-6.6.darwin.tar.bz2

(3) Inside the folder that results, you will find a folder called "darwin" that contains the UNIX executable called (unsurprisingly) "photorec".

(4) Double-click photorec to launch it into the terminal and here's what you'll see:

(5) Select the volume that represents your memory card and hit return to Proceed. In this case, /dev/disk1, is what we want.

(6) At the next screen, which looks like this:

select the partition table, which should be fine at the default setting of "Apple partition map" and hit return to get to this screen:

(7) "Search" will be highlighted. Hit return to start file recovery and you'll see this:

(8) "Other" should be highlighted and should work just fine (or at least it does for me with my setup). This will take you to the last step where you select what directory to recover to, in which case the default folder should be fine. Just select "Y" at this screen:

It will then start processing your memory card and saving what it finds to a folder called "recup_dir.1"

(9) Sit back or go make a sandwich and come back to a folder full of recovered files (hopefully)...which in my case meant a dozen patients' photos perfectly pulled from the digital ashes.

Anyway, it ain't a pretty app and it's not for the faint of heart or those uncomfortable with the Terminal, but it worked beautifully for me (and my patients). Whew!...

Labels: , , , ,


Blogger Dipankar said...

A million thanks dude! Was feeling so low having had accidentally deleted some priceless photographs from my memory card. Downloaded a free software that worked for RAW as well, but the sleazy thing left a huge watermark on the recovered photos. Your blog came to the rescue and I discovered the simplicity of PhotoRec. Three cheers for the Internet! Yippee!

September 9, 2008 6:15 AM  
Blogger David C. Pearson, M.D. said...

You're welcome. Glad it helped!

January 26, 2009 5:46 PM  
Blogger Mike T. said...

You save my life!

March 5, 2009 2:38 AM  
Blogger Matt said...

Thanks so much! Your blog post helped me to get this image back!

July 21, 2009 2:37 PM  
Blogger Cornellison said...

Big thanks for the tip. Works great. Saved some very important images.

September 25, 2009 5:01 AM  
Blogger kamil said...

perfektní software, na mé 16 GB karte za 3-4 hodiny obnovil naprosto vsechno, co bylo na ni kdy uloženo!

(perfect software, my 16 gigabyte card in 3-4 hours and completely restore everything that was on it when stored)

October 14, 2009 12:29 PM  

Post a Comment

<< Home