Ira Abramov wrote:
I have a flash card which I suspect has a defect. every time I go out
and take photos with it, at least one image file comes back corrupted.
to make sure it's not the cammera or something else, I thought it would
be nice to have a memtest-like tool that wrote patterns and tried to
read them again, and see if it is indeed the card that needs replacing.
does anyone know of such a ready-made tool, or should I improvise my own
random patteren writer/tester? (a primitive-but-effective one can be
written in a few lines of perl or even bash of course)


The tool would be useless. The underlying flash (probably NAND technology) storage works in erase blocks sizes, each of which can be written x (for value of x somewhere around 100,000 writes) before it becomes unreliable. The more writes, the lesser the useful life expetency. To combat this the Compact Flash hardware does something called uses a "wear leveling algorithm" to virtualize the low level sectors the OS sees to a different erase block each time.

In short, your tool will not only be unreliable, because a different erase block is used for each write in rotation, it will also activly lower the useful life time of the CF it tests.

NAND flashes actually have a table of bad erase block not to be used. If you can get to the NAND tables via the CF interface (doubt it, but who knows?) you might be able to read it and find our which erase block (or rather how many - all NAND flahses contain some bad erase block that are ununsed) are bad.

Cheers,
Gilad

--
Gilad Ben-Yossef <[EMAIL PROTECTED]>
Codefidence. A name you can trust(tm)
http://www.codefidence.com
Phone: +972.3.7515563 ext. 201  | Cellular: +972.52.8260388
SIP: [EMAIL PROTECTED]  | Fax: +972.3.7515503

        "Dimensionally Transcendent Lorentzian Transformational
                Scheduler...

        Is that the one that lets processes perform an infinite
        loop so fast that they travel back in time and become
        their own process group leader?"

        -- Seen on LWN.

=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to