From: Theodore Tso <tytso@mit.edu>
To: "H. Peter Anvin" <hpa@zytor.com>
Cc: Pavel Machek <pavel@suse.cz>, kernel list <linux-kernel@vger.kernel.org>
Subject: Re: SD/MMC cards: how crappy they are?
Date: Tue, 2 Dec 2008 11:56:08 -0500 [thread overview]
Message-ID: <20081202165608.GD18162@mit.edu> (raw)
In-Reply-To: <493562A5.40308@zytor.com>
On Tue, Dec 02, 2008 at 08:30:29AM -0800, H. Peter Anvin wrote:
> > ...maybe it was because of powerfail? I'll try to run badblocks to
> > recover it...
> >
> > ...I did. Badblocks did not help, but cat /dev/zero > /dev/mmc1
> > did.. And yes, thosse 'temporarily bad blocks' seem very much
> > powerfail related.
> >
>
> Power failures can, indeed, do nasty things to SD/MMC cards, especially
> power rail sag in the middle of writes.
If this is your random eject out from your HP laptop problem, note
that random ejects while the card is writing can cause corruption of
the flash translation layer (FTL), which for some really crappy cards,
can permanently damage them; hopefully most of those are gone from the
market, but I wouldn't be positive about that. The better ones will
have some kind of journalling scheme for their FTL...
Fsck does have a force rewrite option, although it's not the default.
You have to answer "n" to ignore error, and then yes to "force
rewrite". I should perhaps change that; my worry at the time was a
transient read error tricking e2fsck into blowing away the contents of
what was actually a good sector. Of course, that will only help
blocks which fsck actually tried reading; it won't help data blocks.
Badblocks -n will fix the problem, since it will do a non-destructive
read/write test over the entire disk. Patches to add an
forced-rewrite mode to the standard r/o badblocks sweep (so we only
write to a sector that has a read error) would be gratefully accepted.
- Ted
next prev parent reply other threads:[~2008-12-02 16:56 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-02 14:48 SD/MMC cards: how crappy they are? Pavel Machek
2008-12-02 16:30 ` H. Peter Anvin
2008-12-02 16:56 ` Theodore Tso [this message]
2008-12-02 17:59 ` H. Peter Anvin
2008-12-04 10:32 ` Pavel Machek
2008-12-04 19:03 ` H. Peter Anvin
2008-12-26 21:46 ` Pavel Machek
2008-12-26 21:49 ` H. Peter Anvin
2008-12-26 22:39 ` Pavel Machek
2008-12-27 1:03 ` Ben Pfaff
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20081202165608.GD18162@mit.edu \
--to=tytso@mit.edu \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=pavel@suse.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox