On 6 Feb 2009, at 05:28, Iain Buchanan wrote:
It's a Lexar Media 512Mb SD card, a couple of years old. Yes I know I
can get a cheap 2Gb for <$20 but I'm more interested in the
principle of
the test :)
I thought you could get then for < $5, but anyway....
so I created a file:
dd if=/dev/urandom of=Desktop/random.img bs=1024 count=500960
then copied it to the card, and then copied it back as
random-2.img. If
I md5sum the two files, they are identical:
$ md5sum random*
9dcac25cfd8585be5939c0ff969de310 random-2.img
9dcac25cfd8585be5939c0ff969de310 random.img
Does that mean my memory card is good to go, or should I use some
other
method of bad sector detection?
I'd be more or less happy with that methodology, had I copied a
thousand files to the card & they checked out good.
Of the top of my head I don't know how big your "bs=1024 count=500960"
file is - I would make a Bash script generate files c 5meg in size
(maybe alternative between 3meg & 6meg?) and copy them to the card
until it fills up. Then check them, delete them and do so again until
all 1000 have been copied & checked.
Personally, I wouldn't be happy with one file being copied & stored
ok, but I'd probably be happy if the card had proved itself to safely
store 1000. And 3meg - 6meg is the size of the jpegs taken by my mum's
camera. I would want to fill up the card, as flash cards try to avoid
the bad blocks - if you don't fill it, you could be missing some duff
block every time; once you've filled it you know that all the blocks
are good. For some values of "good", that is - you don't know about
longevity, and these cards are really just black boxes to us - we have
no idea what magic goes on inside.
Personally, for my money, I don't know if I'd trust it. Depends what
you're storing on it. MP3s for my phone? Sure - I have a backup at
home. Moving files onto my PS3 or Wii, sure. For my camera? Maybe I'd
be a bit cautious.
Stroller.