"A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly. Specialization is for insects." (Robert A. Heinlein)

Friday, 20 January 2012

Recovering photos from a damaged SD Card (again)

It happened again! I suppose it's because of some hardware problem but my old Sempron 2400, every now and then, makes unreadable a SD card while I'm reading it. This time the damage had been particularly nasty since the recovery method I usually apply (using foremost command) only recovered a handful of of files before stopping because of a “write error”. I so tried another recovery program: Photorec.

Installation and recovery

Photorec is part of the Testdisk disk recovery package it can be installed form Ubuntu's software centre or with apt-get command
sudo apt-get install testdisk
once installed Photorec can be executed by command line
sudo photorec
Photorec has a simple but effective character interface with a wizard-like organization: at first I've been asked for the device to recover

then the partition type, I selected “Intel

then I've been asked to select the partition to be recovered. A whole disk option is also available. Since my SD card had only one partition this selection was irrelevant in this case (I tried both with the same result).

then I had to select the filesystem type, I selected “other” since the SD card was FAT formatted

once selected the file system I've been shown two scanning option “Free” to scan only unallocated disk space and “Whole” to scan the entire partition. I selected the second option since I was trying to recover a damaged partition, while the first would be more suited for recovering accidentally deleted files.

at last I selected the recovery path

the recovery process started, I didn't measure the time it took to recover a 4GB SD card but it seemed to me quite reasonable.


I recovered almost all the lost files, rarely you have a 100% recover ratio in cases like this, Photorec is as effective as foremost but far more easier to use. The character user interface may seem raw but it guides the user along all the recover process and and still can be used in non graphical environments like while working from a remote terminal.

No comments :

Post a comment