[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Compact Flash card problem



On Tue, Jun 12, 2001 at 03:57:16PM -0700, Heather wrote:
[snip]
> > A side note:  I've had some trouble after unmounting and ejecting my CF
> > card, in that Linux complains about a lost interrupt.  This tends to cause
> > filesystem corruption as well, so I recommend the workaround of only
> > removing the card when the laptop is powered off.
> 
> If you have any hot-swappable item with a filesystem, you should always
> sync and umount it before powering it off, and eject it only when powered
> off.  The card, that is - powering down the whole laptop is overkill.

I'd think so, yes.  But I had the following sequence once:
do stuff with mounted CF card
sync
umount CF filesystem
cardctl eject (here Linux complains about interrupt loss)
remove card
halt
on reboot, main ("/") FS is corrupted.

My best guess is that some kernel data structures are/were shared between
the ide of the main HD and the ide of the CF card, and removing the CF
card confused the drivers in a way that looked like a hardware failure.

The reason I power off the laptop is that that guarantees that Linux isn't
doing anything with it right then.  :-)  That, and my usage habits are such
that waiting until the next powerdown to remove the card isn't a big deal.

I may have buggy hardware too, for that matter.

> In theory, umount syncs the filesystem.  And also in theory powering off
> a card (by means of 'cardctl eject') would umount whatever filesystem is
> on it.  But in practice I once saw a PCMCIA connected drive (was it a 
> type III? I forget) wedge when it was powered off, because it didn't want
> to umount fast enough.  I hope pcmcia code has gotten better since those
> bad ol' days, but direct experience like that makes me nervous.  So I
> understand why Jon is nervous about getting an fs mangled.

It wasn't so bad in this particular case, since all I needed to do was
rebuild some config files that were eaten on fsck.  But it was repeatable,
and I don't particularly enjoy running fsck.  That, and I've had some bad
fsck experiences.  Once I got the "this doesn't look like an ext2 fs"
message, and a long time ago (on Amiga SVR4 1.1 - not Linux) had to
reinstall, because fsck ate /etc/passwd (and recovery wasn't implemented).

Jon Leonard



Reply to: