Recovering Photos With PhotoRec

photorec

A coworker approached us today with a corrupted SD card. It was out of her digital camera, and when plugged in, it wasn’t recognized. This looked like the perfect opportunity to try out [Christophe Grenier]’s PhotoRec. PhotoRec is designed to recover lost files from many different types of storage media. We used it from the command line on OSX, but it works on many different platforms.

It’s a fairly simple program to use. We plugged in the card and launched PhotoRec. We were prompted to select which volume we wanted to recover. We selected “Intel” as the partition table. PhotoRec didn’t find any partitions, so we opted to search the “Whole disk”. We kept the default filetypes. It then asked for filesystem type where we chose “Other” because flash is formatted FAT by default. We then chose a directory for the recovered files and started the process. PhotoRec scans the entire disk looking for known file headers. It uses these to find the lost image data. The 1GB card took approximately 15 minutes to scan and recovered all photos. This is really a great piece of free software, but hopefully you’ll never have to use it.

17 thoughts on “Recovering Photos With PhotoRec

  1. I know half of the fun is using the command line, but I use a program that’s worked in the past called Exif Untrasher. (http://www.bluem.net/downloads/exif-untrasher_en/) It’s Mac OS X 10.3+ only but it’s really fast and works really well. It took around 9 minutes to scan and recover pictures from my 2GB card. What it does is it creates a disk image from the card on your HDD and then uses the image to recover, so you don’t have to deal with the slow USB read/write speeds. It’s always worked for me.

  2. Photorec is an awesome tool, there are a few others that are pretty swell as well. Recuva, Foremost, Scalpel (a rewrite of Foremost) are just a few free tools out there that do file carving.

    @Steve: It’s always best to work from an image on any sort of recovery as you don’t want to thrash the media any more than you have to, to get your info.

    Don’t forget about Photorec’s brother Testdisk, which also works from a dd-style image (ddrescue a failing hard drive, mount it to a loopback device and fire up Testdisk, and you’re good to go).

    Even better, if you’re stuck with a Windows box, is using the open source VDK, which allows you to mount a dd-style image in Windows, and access it with any recovery tool. That’s just plain win-sauce.

  3. Thank you so much, I’ve got a dead 2gb micro sd card with an adapter that I’ve been using as a thumb drive. It has the only copy of much of my most critical data on it (including nudes of my ex-girlfriend I’ve been wanting to post on the internet). I have used every data recovery program I could find, including all that were mentioned by the posts above mine but none worked. I was just about to give up and re-format when I read today’s post.

    Thank you hack a day,
    my life just wouldn’t be the same without your guidance… or lasers.

  4. I’ve used photorec several times, including once to recover a 120GiBs HD disk.
    It makes fantastic things, but since it wont recover folder structure, it aint perfect. but thats a filesystem prob, and not app.

    @finch any link for the site of your pics?

  5. It also works pretty good when you format your wife’s computer and loose every picture since you first started dating. Oddly enough “What do you mean you don’t have backups?” doesn’t help… One thing I noticed is that it finds every picture, thumbnails, icons, etc… This leads to quite a bit of sorting at the end, as you have a lot of images, but it’s better than the alternative.

  6. @Steve, I’ve never been concerned with USB read/write speed, just so long as I used my lappy with it’a faster bus speed. That way I get true USB 2.0 speeds.

    The slower bus and over all bottleneck of my desktop’s USB 1.1 however make me shit kittens in frustration. <.<

  7. I have used photorec multiple times when i accidentally delete pictures and files for my laptop. I run Gentoo Linux and my home dir is reiserfs. I have had no problems recovering files.

    I have also used it on 2 occasions for friends, one her HD was dieing and another she deleted all her pictures and then wanted them back..

    DD image makes it much faster as well.

    Sorting after wards sucks but i will check out some of the mentioned apps above as well.

  8. It is also a great party trick to use on the hosts computer. Sure they cleaned the house and deleted all their incriminating photos on the computer, but none are prepared for photorec.

    Note to self DBAN all computers before next party.

  9. I just used this last night on my SD card from my camera. My GF had borrowed it and accidentally erased it in her new camera. I got the pictures back that I lost and saw some other pics on there from a long time ago that I thought would have gotten overwritten dozens of times since then. Scary stuff. I won’t be leaving old memory cards laying around anymore until I can wipe them clean somehow.

  10. I am a witness that this program does work. I one time overwrote over my linux dev/hdb which was hosting all family picture (and I mean ALL: honeymoon, new house,etc..) and I was able to recover using photorec. I lost a few video files, but some were saved as well.

  11. Thank you so much for this program, I finally tonight was able to recover over 100 gigs worth of data of my corrupt 350gig seagate drive. I was just getting ready to use their program to write 0’s to it but this helped me out much much more. This has been a lifesaver for me as I had many of my inventions on said HDD and thought that they were gone forever. Not to mention 8 years worth of family photos and home videos that I made. Thank you oh so very much. you have no idea how happy I am today. Where’s ur donate button?

  12. I am getting a “memory card error” on my cannon SD1G Memory card and want to use this program to recover. Do I have to have an external card reader hocked up to my computer (mac)? I hoped that the USB cord that I use to download pictures from the Cannon PowerShot would work, but I got a message saying “no device” when I tried. Any tips? Thanks

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.