forced fsck (again?)

Bryan Kadzban bryan at kadzban.is-a-geek.net
Thu Jan 24 02:10:31 UTC 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160

Andreas Dilger wrote:
> On Jan 23, 2008  09:08 -0500, Theodore Tso wrote:
>> (We could sneek some of that information into the options field of
>> fstab, since the kernel and other programs that parse that field
>> just take what they need and ignore the rest, but.... ick, ick,
>> ick.  :-)
> 
> I agree - adding email to fstab is icky and I wouldn't go there.  I
> don't see a problem with just emailing it to "root@" by default and
> giving the user the option to change it to something else.

Since the email address is not per-filesystem, it's fine by me to put it
into a config file somewhere.  Forcing the interval to be global is
probably also OK, although I wouldn't want to be forced to set the
snapshot size globally.  I do think that fstab is the best place for
per-filesystem options, though.

But it's not too difficult to parse out a custom SNAPSIZE option, and
even have a DEFAULT_SNAPSIZE in the config file if no SNAPSIZE option is
present on any LV, if the script is going to parse fstab anyway.  (Or
should the option's name be lowercase?  Either will work.)

>> Also, I could imagine that a user might not want to check all of
>> the filesystems in fstab.
> 
> Similarly, a config file which disables checking on some LV if
> specified seems reasonable.

That does seem reasonable, but I haven't done it in the script that's
attached.  Maybe support for a SKIP (or skip, or e2check_skip, or
skip_e2check, or whatever) option in fstab's options field?

Regarding the idea of having this support multiple filesystems -- that's
a good idea, I think, but the current script is highly specific to ext2
or ext3.  Use of tune2fs (to reset the last-check time) and dumpe2fs (to
find the last-check time), in particular, will be problematic on other
FSes.  I haven't done that in this script, though it may be possible.

Anyway, here's a second version.  I've changed it to parse up fstab,
and added an option for what to do if AC status can't be determined.
Kernel-style changelog entry, etc., below:

- -------

Create a script to transparently run e2fsck in the background on any LVM
logical volumes listed in /etc/fstab, as long as the machine is on AC
power, and that LV has been last checked more than a configurable number
of days ago.  Also create a configuration file to set various options in
the script.

Signed-Off-By: Bryan Kadzban <bryan at kadzban.is-a-geek.net>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHl/OXS5vET1Wea5wRA/UaAJwIE27W6qasI7Gm/uvZm/pY1rcBtwCcDXYq
cc3qE/uOEqm4ksYHlI6+IJU=
=7Lf3
-----END PGP SIGNATURE-----
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: e2check
URL: <http://listman.redhat.com/archives/ext3-users/attachments/20080123/b9bc38ad/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: e2check.conf
URL: <http://listman.redhat.com/archives/ext3-users/attachments/20080123/b9bc38ad/attachment.conf>


More information about the Ext3-users mailing list