Tag Archives: photo

How to recover deleted photos and other files for free

If you have never accidentally deleted a file, or accidentally formatted your camera’s memory card, don’t read this post πŸ™‚ Otherwise, here’s something I just found out, trying to help a friend whose SD card had mysteriously formatted itself (don’t ask), thereby nuking about 400 photos.

There are, of course, several commercial file recovery utilities for both Windows and Mac. I’m sure they can generally do a good job. In this case, I experimented with a few trial versions, which typically show you what’s recoverable but do not actually retrieve the files. Unfortunately, I had only very limited success with commercial offerings: very few pictures appeared to be recoverable, no matter which software I tried. That was what I expected, actually; for this reason, when I asked my friend to leave her supposedly dead or dying SD card with me, I made it clear that, short of miracles, her pictures were probably gone for good.

Well, I found a miracle-worker, and its name is PhotoRec. Actually, PhotoRec is part of a package called TestDisk, which does tons more than just recover deleted files, but requires more user intervention. If all you need to do is recover photos, PhotoRec is what you want.

This, ladies and gentlemen, is Free Software at its finest. Yes, it’s free-as-in-beer, as well as free-as-in-libre. Most of all, it’s quality software that does what it’s supposed to, and does it well. Once you point PhotoRec to the drive (hopefully still) containing your photos, and you give it some additional information (see below), you just need to wait while it works its magic. In my case, it was able to recover not just all the recent photos my friend was worried about, but also a lot of pictures that had been deleted up to two years ago. (Friendly advice: don’t rely on your camera’s “Erase All” function to get rid of embarassing pictures!) Last but not least, it’s multiplatform: it runs on Windows, Mac, Linux, and even other platforms. Win!

The downside of PhotoRec is that, well, it is Free Software at its finest πŸ™‚ Let’s just say that user friendliness was not a key design requirement. PhotoRec is distributed as a zip file that you simply extract wherever you want (even your desktop, if you are lazy). Then, on Windows, you run the photorec_win.exe executable (I haven’t tried it on the Mac). However, if you are expecting a nice friendly Windows dialog, you will be disappointed: PhotoRec runs in the Windows console, and uses an 80s style menu interface. You use the arrow keys to highlight different options, and (generally speaking) Enter to select one of them and advance to the next screen, where new options are presented, until PhotoRec is ready to go to work.

But this makes the process sound harder than it really is. Here’s a very quick summary (refer to the instruction on the PhotoRec site). First of all, you must create a directory on your PC’s hard disk where you will store the recovered pictures. You need to do this before running PhotoRec. Second, once you run the PhotoRec executable, you will see the Windows UAC prompt, because PhotoRec must run as Administrator in order to perform low-level access to your drive. Third, PhotoRec needs to know the following (listed in the order the screens appear in the app):

  1. Which drive contains (or used to contain…) your pictures. PhotoRec lists your drives, calling them something like /dev/sda (which most likely is your PC’s hard disk), /dev/sdb, etc. However, it also indicates the size and provides a device description. For instance, right now I have a 32GB MicroSDHC card in my Samsung 7 Slate, which appears as a “31 GB / 29 GiB – Generic STORAGE DEVICE”. That’s the kind of entry you should be looking for. In any case, don’t worry: drives are mounted read-only, so you can’t mess up your files!
  2. Which partition on that drive should be used. This is usually easy to guess. On an SD card, either there is a single partition, or there is a small one containing “helpful” software from your friendly manufacturer, and a large one for your data. Pick the large one.
  3. Which format the selected partition uses. PhotoRec will try to guess, but if you are recovering files from an SD card, it’s almost certainly going to be FAT or maybe NTFS.
  4. Whether PhotoRec should look for pictures only in the space marked “free”, or on the “whole” disk. I chose “whole.”
  5. Finally, where to save your recovered pictures. Here you have to navigate to a directory (folder) on your PC’s hard disk. Again, you must create this folder before running PhotoRec. Navigate to it, then hit “C” (don’t ask) to select.

At any time in the previous steps, you can hit Ctrl-C to quit—no questions asked, no mess. But, if you make it all the way to the end, just leave PhotoRec alone and it will do its job. Warning: this may take some time, so make sure your PC is plugged in, so it doesn’t go to sleep.

Finally, a disclaimer or two. Your mileage may vary, and indeed I’d be interested to hear your experience. Also, the safest form of data recovery is backing up! That said, PhotoRec performed admirably. This time, I earned my friend’s gratitude. Next time, it could actually save my own skin!

Transferring pictures from the Nikon D5100 DSLR

I have a new toy: a Nikon D5100 DSLR, and am eager to share a tiny tip. I’ll save the rationalizing and editorializing for a later post πŸ™‚

My previous camera (an Olympus C-8080) supported the USB mass storage protocol, which means that, as soon as you connected it to a Mac or PC and turned it on, it would show up as a new drive on the desktop. From there, you could simply drag and drop files into your favorite location on your HD. Of course, on the Mac, you could also set iPhoto or Image Capture to launch upon connection and take care of transferring files, but this was strictly optional. My Macbook Pro is configured to not open any application when a camera is connected, and I want it to stay that way!

Well, the D5100 does not support the USB mass storage protocol. However, this does not seem to be explicitly documented. The manual simply states that, in order to transfer pictures, you “need to” install the software that comes with the camera. Once you do that, as soon as you plug in the D5100 and turn it on, something called “Nikon Transfer 2” is launched, and you can use its ominously gray and most unMaclike UI to transfer photos and movies.

Besides offending my aesthetic sensibility, this is inconvenient: what if you need to transfer photos from your camera to a friend’s computer, but do not have the install disk with you?

Well, not to worry. The D5100 supports the so-called PTP protocol. Nikon Transfer 2 merely talks to the D5100 using PTP. However, you can use any PTP-speaking software instead! In particular, iPhoto and Image Capture on the Mac work just fine!

Bottom line: you do not need to install any Nikon software, unless of course you require it for other reasons. Connect the camera and turn it on. If you have iPhoto configured to launch whenever a camera is plugged in, iPhoto will in fact launch and will transfer your files as usual. If your Mac is configured so nothing launches when you plug in a camera, then manually launch either iPhoto or Image Capture, and again they will work just fine.

Incidentally, to choose which app to launch when a camera is plugged in (or, to ensure that no app is launched at all), you can use either iPhoto (look in Preferences) or Image Capture (look at the drop-down menu in the bottom left corner of the main window). This may be handy if, for instance, you installed the Nikon Transfer 2 software as I did, but no longer want to see it when you plug in your camera. As far as I can tell, there is no “centralized” way to change this setting (e.g., in System Preferences).