File system checking on ext3 after a system crash

Andreas Dilger adilger at
Mon Apr 9 18:11:21 UTC 2007

On Apr 09, 2007  08:56 -0400, Theodore Tso wrote:
> 2) If you are using LVM/DM, and you have the capability to create
> copy-on-write snapshots, and once a month or so, at 3am on a Sunday
> night, or some other low-utilization time, have a cron script fire of
> the COW snapshot, and then run e2fsck -n on that snapshot.  If e2fsck
> reports any errors, have the script mail the results to the
> administrator, so the administrator can schedule downtime to run an
> fsck to fix the error.  If no errors are reported, the script can use
> "tune2fs -C 0 -T now /dev/sdXX" to reset the number of moutns since
> the last filesystem check and last checked time on the original
> filesystem (it is safe to do this on a mounted filesystem).

Actually, I don't think you need a writable snapshot.  The LVM driver will
ask the ext3 code to politely flush and lock the journal before doing the
snapshot so that no recovery needs to be done on the read-only snapshot.
See ext3_write_super_lockfs() and ext3_unlockfs().

Cheers, Andreas
Andreas Dilger
Principal Software Engineer
Cluster File Systems, Inc.

More information about the Ext3-users mailing list