[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.
 
How odd.  If you Suspend To Disk (so the computer is off) and normally just
make sure the CF is back in before you turn it back on, does it still break
wickedly?

For that matter if you resume with the CF *not* in there (because you popped
it out after susp-2-disk)  does it immediately gag and die?

> 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.
 
My use of ATAPI cards always looked like an extra IDE controller was added.
So I've never had an hdb but the cards come up hdc or hdd (usu. hdc).    
I've had times where it wouldn't free up that resource when I popped a card,
but it never harmed my regular disk, just the ability to work sanely with
another ATAPI-card.  (I get away with it once, since there's dev nodes for
hde/hdf, but if it insists on doing it again, I bail and reboot  I can 
mknod some nodes but I figure that some deep IDE magic is screwed up by then.)

> 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.
 
Well, okay, if it fits your usage that's not so bad, anyway.

> 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).

Ouchie.  I do like to back /etc up seperately once in a while - it's not 
nearly as big as the whole kit, and it's pretty important if you need to 
rebuild.  That, and dpkg --get-selections ...

* Heather Stern * star@ many places...



Reply to: