From 3dbbd1e28eb12171be6c8c76098a5da579724d5b Mon Sep 17 00:00:00 2001 From: Tom Gundersen Date: Thu, 24 Nov 2011 14:27:24 +0100 Subject: 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 --- functions | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'functions') 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) -- cgit v1.2.3