Automatic fsck

Andrew Sayers andrew-ubuntu-devel at pileofstuff.org
Thu Aug 14 02:12:44 UTC 2008


Alexander Jones wrote:
> Because people are talking about snapshotting a FS in a potentially
> broken state, fscking it in the background---whilst continuing to use
> it!
> 
> Assuming that using a broken FS doesnt hose it (admittedly it
> shouldn't), merging a changeset from a broken state into a repaired
> state is a process which I think will be extremely fragile and prone
> to breakage, /especially/ if attempted FS-agnostically.
> 
> I willfully invite people to prove me wrong, just tell me how to
> disable it before it eats my data. Or limit your scope a bit and
> thrash this out properly, for a single filesystem (hint, Ext3!), on
> LKML.
> 

Right, I understand your objection now.  Some points I'd like to make:

As I said before, merging back is at most something to consider in
version 2.  For now it's enough to use the snapshot in read-only mode to
confirm whether the FS actually needs to be fixed.

I'm only suggesting this be used in place of the regular boot-time
fsck's that hardly ever turn up anything of interest.  IMHO, when
there's any significant probability of breakage, fsck's should be done
before the disks are mounted - not in a snapshot, not online.

As to the dangers of a broken FS, consider the following: disks are
currently fsck'd once every few mounts/months.  In order for that
regular check to find a problem, you would have to be use a broken FS
for anything up to that many mounts/months without noticing.  If a cron
job checks your disks twice as often (without modifying them), and
triggers an old-fashioned boot-time fsck at the user's earliest
convenience, that only serves to augment the current system by reducing
the amount of time that you're using a broken FS.  That said, I'd like
to amend my previous proposal slightly based on your objection:

6b. the snapshot is marked to be destroyed _only after_ a successful
fsck of the main volume.  In the event that the main volume is too badly
damaged, the snapshot might aid in recovery.

If you didn't go out of your way to manage your disks with LVM when you
installed Ubuntu, then this solution would be automatically disabled for
you.  Snapshotting requires LVM, which is currently only an option if
you install from the alternate CD.  I'm not aware of any mechanism to
upgrade a normal partition table to LVM, so this solution would only
work for new installs and systems that already use LVM.

	- Andrew




More information about the Ubuntu-devel-discuss mailing list