The 512Mb memory card I've been using with my camera appears to be a bit dodgy. I bought it last year, to use on my trip to the UK (where I wouldn't have the luxury of downloading photos to a computer); after a while, photos started being corrupted. I put this down, at the time, to my camera malfunctioning (a bit got snapped off the little plastic mode-switch wheel whilst I was in London, and so I couldn't shut down the camera, other than waiting for it to go to sleep, until I got it replaced back home).
I took the 512Mb card out of storage for my trip last week, and took some photos. At first it seemed OK, but then photos started getting written badly and corrupted. Though I could see what had happened and take another one, or so I thought.
Now, as I plugged it into my computer, I noticed that photos that looked OK on the camera seemed to have had bits truncated; more seriously, somewhere along the way, most of a directory on the card got clobbered, taking somewhere under 100 photos (starting in Sydney and ending in Byron Bay) with it. I'm not sure when this happened; presumably when I was in Byron Bay, as there are 3 photos (numbered in the high 90s) in that curiously empty directory.
Do CF cards have bad sectors that can be mapped as bad, as hard disks do, or is the card itself a dead loss?
The card is probably a loss. Like a floppy disk, chuck it at the first sign of trouble.
Mind you, you could probably recover a lot of the photos by dd'ing the card to a hard disk, then going through looking for the JPEG headers. I have done this.
Replies Frozen · Thread
sbp did the actual recovery - dd from the CF card (which is a FAT hard disk as far as the operating system is concerned) to a file, then go through that with a Perl script assuming a JFIF header (0xFFD8FFE0) is the start of a file. I can't find the script he used (it's somewhere in my email pile), but it verges on the trivial. Once you have a pile of recovered file fragments, the GIMP is pretty forgiving in trying to turn them into viewable images.
Once you've recovered the files, throw away the troublesome CF card.
I wrote a program which uses this technique, and got a directory full of JPEG-like spans out of it (which I'll sort through by EXIF timestamp).
Though for some reason, the JPEG files written by my Canon PowerShot start with 0xFFD8FFE1, not 0xFFD8FFE0. Maybe that's the difference between EXIF files and vanilla JFIF?