The other day, I received a friend’s camera where no pictures were readable anymore. After examining the memory card, it was clear that the file system was corrupted, however some photos might still be available.
Photorec is a great tool for this job. It can be found in the ubuntu repositories and is pretty straightforward to use. It basically reads all bits and bytes on the memory card and looks for the beginning and end of image files.
In case you are worried about overwriting files on the memory card with the tool, you can first create an image of the disk.
sudo dd if=/dev/sdb1 of=image.dd
/dev/sb1 is the path to your mounted memory card. If you are unsure which device it is, check your mount table with the ‘mount’ command. Keep in mind that this step can take quite some time to finish, depending on the size of the memory card.
Then simply run :
Follow the on-screen instructions to finish recovering the files. In my case, photorec was able to recover all lost pictures.