Gentoo Archives: gentoo-user

From: Stroller <stroller@××××××××××××××××××.uk>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] testing a corrupt SD card
Date: Fri, 06 Feb 2009 07:11:24
Message-Id: 5402825E-740B-4ACC-9B67-E9AF5390714D@stellar.eclipse.co.uk
In Reply to: [gentoo-user] testing a corrupt SD card by Iain Buchanan
1 On 6 Feb 2009, at 05:28, Iain Buchanan wrote:
2 > It's a Lexar Media 512Mb SD card, a couple of years old. Yes I know I
3 > can get a cheap 2Gb for <$20 but I'm more interested in the
4 > principle of
5 > the test :)
6
7 I thought you could get then for < $5, but anyway....
8
9 > so I created a file:
10 > dd if=/dev/urandom of=Desktop/random.img bs=1024 count=500960
11 >
12 > then copied it to the card, and then copied it back as
13 > random-2.img. If
14 > I md5sum the two files, they are identical:
15 > $ md5sum random*
16 > 9dcac25cfd8585be5939c0ff969de310 random-2.img
17 > 9dcac25cfd8585be5939c0ff969de310 random.img
18 >
19 > Does that mean my memory card is good to go, or should I use some
20 > other
21 > method of bad sector detection?
22
23 I'd be more or less happy with that methodology, had I copied a
24 thousand files to the card & they checked out good.
25
26 Of the top of my head I don't know how big your "bs=1024 count=500960"
27 file is - I would make a Bash script generate files c 5meg in size
28 (maybe alternative between 3meg & 6meg?) and copy them to the card
29 until it fills up. Then check them, delete them and do so again until
30 all 1000 have been copied & checked.
31
32 Personally, I wouldn't be happy with one file being copied & stored
33 ok, but I'd probably be happy if the card had proved itself to safely
34 store 1000. And 3meg - 6meg is the size of the jpegs taken by my mum's
35 camera. I would want to fill up the card, as flash cards try to avoid
36 the bad blocks - if you don't fill it, you could be missing some duff
37 block every time; once you've filled it you know that all the blocks
38 are good. For some values of "good", that is - you don't know about
39 longevity, and these cards are really just black boxes to us - we have
40 no idea what magic goes on inside.
41
42 Personally, for my money, I don't know if I'd trust it. Depends what
43 you're storing on it. MP3s for my phone? Sure - I have a backup at
44 home. Moving files onto my PS3 or Wii, sure. For my camera? Maybe I'd
45 be a bit cautious.
46
47 Stroller.

Replies

Subject Author
Re: [gentoo-user] testing a corrupt SD card Iain Buchanan <iaindb@××××××××××××.au>