aboutsummaryrefslogtreecommitdiff
path: root/functions
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2011-11-24 14:27:24 +0100
committerTom Gundersen <teg@jklm.no>2011-11-26 12:38:59 +0100
commit3dbbd1e28eb12171be6c8c76098a5da579724d5b (patch)
treebd752ecb6ef03844f128bf13cc09838bdd137103 /functions
parent5c97cee2732ec21790e40f391de664bcd64eeb1b (diff)
downloadinitscripts-3dbbd1e28eb12171be6c8c76098a5da579724d5b.tar.xz
fsck: skip remounting / fsck'ing the root fs
In case the initramfs already fsck'ed and mounted the root fs ro, we don't remount ro and fsck. We still remount the rootfs rw unconditionally at the end. We should probably stop doing this and require the user to specify rw/ro explicitly in fstab. We assume that the initramfs will also fsck and mount /usr, so we do not fsck any mounted fs (not restricted to the rootfs). Signed-off-by: Tom Gundersen <teg@jklm.no>
Diffstat (limited to 'functions')
-rw-r--r--functions6
1 files changed, 5 insertions, 1 deletions
diff --git a/functions b/functions
index 8f9a5d2..74719db 100644
--- a/functions
+++ b/functions
@@ -428,7 +428,11 @@ NETFS="nfs,nfs4,smbfs,cifs,codafs,ncpfs,shfs,fuse,fuseblk,glusterfs,davfs,fuse.g
# Check local filesystems
fsck_all() {
- fsck -A -T -C"$FSCK_FD" -a -t "no${NETFS//,/,no},noopts=_netdev" $FORCEFSCK
+ if [[ -e /run/initramfs/root-fsck ]]; then
+ IGNORE_MOUNTED="-M"
+ fi
+
+ fsck -A -T -C${FSCK_FD} -a -t no${NETFS//,/,no},noopts=_netdev ${FORCEFSCK} ${IGNORE_MOUNTED}
}
# Single-user login and/or automatic reboot after fsck (if needed)