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

Re: Yanking a USB Hard Drive/ReiserFS causes Kernel Panic

John L Fjellstad wrote:
William Ballard <nospam_40811@alltel.net> writes:

I have an external USB 2.0 2.5" hard drive, shows up as /dev/sda, with an ReiserFS partition. If I yank it with it mounted ReiserJS panics.
I have the fstab entry marked as sync, rw.

I think it might be because reiserfs is a journaling filesystem. I know
I sometimes forget and remove my usbkey (which has FAT) without
unmounting, and don't see the problems you see.  Even ext2 should be

Absolutely not. The point of keeping a journal is to preserve the integrity of the filesystem even in an operation is unexpectedly interrupted (whether by a crash or a power failure). This should provide resilience to disconnection, too, but that doesn't mean disconnection without warning would be safe: the integrity of the filesystem is not the same as the integrity of every file within it.

If an ext2 filesystem is not cleanly unmounted then there is no guarantee that it will be consistent or quickly repairable. It must generally be fully scanned and repaired by e2fsck. If the filesystem is not mounted with metadata ordering enabled, even that won't necessarily work.

FAT isn't resilient to interruption either. FAT filesystem implementations tend to be extremely conservative in ordering of changes, which may make it relatively safe to disconnect a FAT filesystem without unmounting it. However, there's no way of telling whether a FAT filesystem has been cleanly umounted or not, so filesystem damage can easily go unnoticed for some time, giving a false sense of the safety of this practice.


Reply to: