* Make fsck on journaling filesystems optional (enabled by default).

This is because fsck.ext3 takes several minutes to recover the
  journal, whereas the ext3 implementation in the kernel only takes a
  few seconds.  I'd love to know why this is the case...

svn path=/nixos/branches/modular-nixos/; revision=15965
This commit is contained in:
Eelco Dolstra 2009-06-15 16:47:37 +00:00
parent 048e03377f
commit 16937dd23d
2 changed files with 21 additions and 0 deletions

View File

@ -146,6 +146,17 @@ checkFS() {
# Don't check ROM filesystems.
if test "$FSTYPE" = iso9660 -o "$FSTYPE" = udf; then return 0; fi
# Optionally, skip fsck on journaling filesystems. This option is
# a hack - it's mostly because e2fsck on ext3 takes much longer to
# recover the journal than the ext3 implementation in the kernel
# does (minutes versus seconds).
if test -z "@checkJournalingFS@" -a \
\( "$FSTYPE" = ext3 -o "$FSTYPE" = ext4 -o "$FSTYPE" = reiserfs \
-o "$FSTYPE" = xfs -o "$FSTYPE" = jfs \)
then
return 0
fi
# Don't run `fsck' if the machine is on battery power. !!! Is
# this a good idea?
if ! onACPower; then

View File

@ -54,6 +54,14 @@ let
";
};
boot.initrd.checkJournalingFS = mkOption {
default = true;
type = types.bool;
description = ''
Whether to run fsck on journaling filesystems such as ext3.
'';
};
fileSystems = mkOption {
options.neededForBoot = mkOption {
default = false;
@ -215,6 +223,8 @@ let
inherit (config.boot) isLiveCD resumeDevice;
inherit (config.boot.initrd) checkJournalingFS;
# !!! copy&pasted from upstart-jobs/filesystems.nix.
mountPoints =
if fileSystems == null