From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([69.77.167.62] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1LXACj-00018X-8v for garchives@archives.gentoo.org; Wed, 11 Feb 2009 08:12:21 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 3757CE02D5; Wed, 11 Feb 2009 08:12:19 +0000 (UTC) Received: from mail.netspace.net.au (mail-out5.netspace.net.au [203.10.110.92]) by pigeon.gentoo.org (Postfix) with ESMTP id E2696E02D5 for ; Wed, 11 Feb 2009 08:12:18 +0000 (UTC) Received: from [121.90.70.150] (unknown [121.90.70.150]) by mail.netspace.net.au (Postfix) with ESMTP id B0C52171D59 for ; Wed, 11 Feb 2009 19:12:12 +1100 (EST) Subject: Re: [gentoo-user] testing a corrupt SD card From: Iain Buchanan To: gentoo-user@lists.gentoo.org In-Reply-To: <5402825E-740B-4ACC-9B67-E9AF5390714D@stellar.eclipse.co.uk> References: <1233898098.21997.10.camel@localhost> <5402825E-740B-4ACC-9B67-E9AF5390714D@stellar.eclipse.co.uk> Content-Type: text/plain Date: Wed, 11 Feb 2009 13:50:47 +1300 Message-Id: <1234313447.21507.45.camel@localhost> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org Mime-Version: 1.0 X-Mailer: Evolution 2.24.4 Content-Transfer-Encoding: 7bit X-Archives-Salt: 396fe628-06f9-4298-926f-e16705fb033d X-Archives-Hash: f89c35d7c0d7785c2e5e7eeaa6ed1efe On Fri, 2009-02-06 at 07:11 +0000, Stroller wrote: > 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.... probably in USD. We (AUD) were approaching 1.00 before the exaggerated crises, but now we're back to 0.645; and plus I needed one in a hurry, so I couldn't order from a PC store which has reasonable prices and instead had to go for a local and slightly more expensive retailer... > > 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" well, I got that from the free space on the card, using df and some mathemagics, so it 100% fills the free space... however... > 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. [snip] however my method and your suggestion only fill up the free space, and not the FAT for example, so there could be corruptions there, and given I could see files but the names were nnnxxnnxnnn.ddxxc and so on, I think it could have been a corrupt FAT?... I should have made a file the size of the whole SD card, and just written it to and read from the device a couple of times, overwriting the partition table, and FAT. > 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. Bought a new 2Gb. Unfortunately I want a 512Mb card cause then I'm forced to back it up often enough. -- Iain Buchanan Men have a much better time of it than women; for one thing they marry later; for another thing they die earlier. -- H.L. Mencken