4
1
I've got a bunch of compact flash cards that I've used heavily in a professional photo and video capacity.
I'm concerned that one of them is going bad, since I am seeing files (most often video, but occasionally photo) become corrupt on a hard to predict basis. I am absolutely sure this is not related to unmounting the card before removing it - the corruption is visible directly after properly removing the card from the camera.
The problem is, I don't know which card is problematic, and the issue seems to be intermittent, so I can't just shoot them full and look for a bad file (and corruption isn't always apparent even then - if the bad bit(s) are within the data portion of a file, it might not be obvious). The problem is rare enough that I can't reliably reproduce it (except when there's a client with a job with files that absolutely, positively cannot be lost - then it's sure to strike).
I could RMA them all under warranty (they're all Sandisk with lifetime warranty), but I'd prefer not to (how do I justify sending in a batch of 5 cards? what do I use during the month that they're gone?).
I'm looking for a tool that will fix them. Specifically, I need something that will do a write/read/write/read cycle for the whole card, and ideally do a full format to remove any bad bits, as well as letting me know the status (is one card particularly bad? are all the others perfectly fine? what level of errors am I seeing on a general basis?).
I'm aware of the badblocks
tool, but was hoping to find something tailored more towards CF (and which would hopefully let me map the bad areas out of use, if it's only a few bits). I would prefer a non-windows tool if possible.
Has anyone else solved this problem without simply blindly replacing your devices? Some of the suspect cards are pretty new.
Hmmm. I had considered dd, but my understanding is that while the process you outlined will write the card, then read it, it won't verify that what is read from the card equals what was intended to be written to it. I could write the output of /dev/random to another file, then do a comparison... I'm hoping there's an easier method though. – Paul McMillan – 2010-08-16T20:17:58.303
@Paul McMillan: dd will detect certain problems, not others. And it won't help to compare to /dev/random since its RANDOM it won't be the same the second time. You can create a filesystem on the CF device, write a bit of /dev/random to a disk file (use the dd count parameter) (or any file you want with cp) , then copy the disk file to the CF device and then take an md5 hash (md5sum -b filename) of both the disk file and the CF file. - - - but this is a bit more work than I thought you wanted to invest. – hotei – 2010-08-16T21:02:06.863
I understand /dev/random. I was referring to running an appropriate amount of it into a file that I could compare to before writing to the card. I think badblocks is the best available tool I've discovered for this job. – Paul McMillan – 2010-08-16T23:46:35.127
@paul~: I thought you might, but had to make sure since others will also come across these posts. – hotei – 2010-08-17T02:13:21.920