Recover photographs from flash disk

I got myself stuck with a corrupt 1GB Compact Flash card. I suspect one of my card readers to be b0rken – need to replace that one.
Broken card reader… you might guess, I got several pictures left on this card, which I didn’t copy yet to my RAID-5 enabled, snapshotted to USB disk, data server. I didn’t even know how many pictures there were left.

I tried some classic DOS/WINDOWS utilities I got in my corporate tool set, but none of them helped. Before diving into more heavy stuff, I decided to make an image of the disk, before all. As every post-mortem analysis specialist will tell you, dd is the tool you need. A quick Google – I never manage to recall what options I need to use on dd (e.g. block size x block count: what difference does different factors make as long as the product is the same?), made me tumble here. Just what I needed.



dd if=/dev/hde of=//CF1GB.img bs=512
wget http://www.cs.washington.edu/homes/oskin/saveimg.cxx
mv saveimg.cxx saveimg.c
gcc saveimg.c -o saveimg
./saveimg CF1GB.img

Impressive little piece of code: it even worked! This got me over 150 pictures, all readable. After checking with my photo repository, it seemed I had only lost 6 pictures, which I easily renamed to fit in. The other pictures were the previous ones which already were erased. I even recovered nudy pics and a picture of a river boat :). Must have been some leftovers from the previous owner of the CF (who didn’t use it exclusive for Digital Camera as I do.)

Update: A friend of mine told me about a Windows app he once used for this, which he sent me by email. As I didn’t get it too soon, I checked my mail logs:
Feb 13 20:19:00 skuniboot amavis[4970]: (04970-03) INFECTED (Worm.Mytob.GH), friend-at-telenet -> serge-at-goldorak.lan.vanginderachter.be>, quarantine virus-20060213-201859-04970-03, Message-ID: <000801c630d1$3d1d8240$0100000a@strat>, Hits: -
Yes, I had a look on saveimg.c 😉 No further comments.