The Smell of Molten Projects in the Morning

Ed Nisley's Blog: Shop notes, electronics, firmware, machinery, 3D printing, laser cuttery, and curiosities. Contents: 100% human thinking, 0% AI slop.

JPG Recovery From a Camera FAT Filesystem

You can do it by hand, as I used to, or use recoverjpeg:

dmesg | tail
cd /tmp
sudo dcfldd if=/dev/sde1 of=pix.bin bs=1M count=100
recoverjpeg pix.bin 
ristretto image00*

Nothing prizewinning, but better than no picture at all:

Garage Robin - recovered image
Garage Robin – recovered image

Note that you start by copying a reasonable chunk of the partition from the Memory Stick / (micro)SD Card first, to prevent a bad situation from getting worse.

Now I can remember the easy way the next time around this block …

Comments

4 responses to “JPG Recovery From a Camera FAT Filesystem”

  1. madbodger Avatar
    madbodger

    A friend of mine had a partial disk crash before he could back up the pictures of his newborn baby. The software of the day didn’t really do much, so I ended up crafting my own that worked much like your manual approach, combined with a parser that understood JPEG headers. I was able to recover almost 3/4 of the pictures.

    1. Ed Avatar

      You’re a mighty warrior in the battle against entropy!

  2. scruss2 Avatar

    PhotoRec — https://www.cgsecurity.org/wiki/PhotoRec — is absolutely magic for this. It understands lots of file systems too, so not just for borked camera cards.

    1. Ed Avatar

      I vaguely recall fighting a pitched battle with PhotoRec some years ago, perhaps along with TestDisk, but having a better set of hammers at the ready is always a Good Thing.

      Despite their saying “uses read-only access”, I’d still (try to) to copy the entire filesystem for safekeeping. Ya never know what can go wrong or when!

      Thanks for the pointer …