#17 LVM/Device-mapper and RAID dependency support in fsck

open
nobody
None
5
2012-11-28
2005-01-04
Mike Nix
No

LVM, Device Mapper and RAID devices are not checked in
parrallel, even though these devices are usually quite
large and would benefit most from this.

This patch adds full support for determining the
dependent devices of RAID and LVM volumes, even if they
use partitions sharing the same physical device.
LVM/Device-Mapper support requires /sbin/dmsetup - but
you need that to set up Device-Mapper or LVM anyway.

It also adds support for "slow" or "non-essential"
filesystems (ie large bulk storage filesystems like my
750GB LVM volume that takes 45 minutes to fsck) in the
form of a -S parameter.

To specify a "slow" volume in fstab, use a negative
fs_passno (-1 is reserved, I reccomend -3 or less) and
use the noauto option so that it is not mounted at boot.

Later, say in rc.local, run something like

(sleep 30; fsck -C -R -A -S -m -a > /tmp/fsck.progress
2>&1 )&

to perform the usual fsck on all "slow" volumes (-S) in
the background and mount them (-m) when the check
completes successfully. You can monitor progress with
"tail -f /tmp/fsck.progress"

You will also need this small patch to mount to accept
negative pass numbers in fstab. (this patch has been
submitted to the mount maintainer)
---------------------------------------------------
diff -urN util-linux-2.12p/mount/mntent.c
util-linux-2.12p-mike/mount/mntent.c
--- util-linux-2.12p/mount/mntent.c 2004-10-14
04:57:34.000000000 +0800
+++ util-linux-2.12p-mike/mount/mntent.c
2005-01-02 19:49:41.000000000 +0800
@@ -200,9 +200,9 @@
goto err;

s = skip_spaces(s);
- if(isdigit(*s)) {
+ if(*s=='-' || isdigit(*s)) {
me.mnt_passno = atoi(s);
- while(isdigit(*s)) s++;
+ while(*s=='-' || isdigit(*s)) s++;
} else
me.mnt_passno = 0;
if(*s && !is_space_or_tab(*s))
-----------------------------------------------------

Discussion

  • Mike Nix
    Mike Nix
    2005-01-04

    LVM/RAID dependency support for fsck

     
    Attachments
  • Mike Nix
    Mike Nix
    2005-01-04

    patch to util-linux 2.12p mount for negative pass numbers

     
    Attachments