aboutsummaryrefslogtreecommitdiffstats
path: root/rc.d
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2004-03-16 23:34:31 +0000
committerBill Nottingham <notting@redhat.com>2004-03-16 23:34:31 +0000
commit1ba9c5bc389be8b7b1754855dd5a93335de30e6f (patch)
tree7b379556a812902a6d799f416c42c6b010435f44 /rc.d
parent624f45f4647bac5f32c37a6636ec7c436aedacfd (diff)
downloadinitscripts-1ba9c5bc389be8b7b1754855dd5a93335de30e6f.tar
initscripts-1ba9c5bc389be8b7b1754855dd5a93335de30e6f.tar.gz
initscripts-1ba9c5bc389be8b7b1754855dd5a93335de30e6f.tar.bz2
initscripts-1ba9c5bc389be8b7b1754855dd5a93335de30e6f.tar.xz
initscripts-1ba9c5bc389be8b7b1754855dd5a93335de30e6f.zip
fsck the root filesystem from the initrd (#117575)
Diffstat (limited to 'rc.d')
-rwxr-xr-xrc.d/rc.sysinit27
1 files changed, 16 insertions, 11 deletions
diff --git a/rc.d/rc.sysinit b/rc.d/rc.sysinit
index 30a651b8..2cb861ca 100755
--- a/rc.d/rc.sysinit
+++ b/rc.d/rc.sysinit
@@ -83,15 +83,6 @@ fi
RHGB_STARTED=0
mount -n /dev/pts
-# Unmount the initrd, if necessary
-if LC_ALL=C fgrep -q /initrd /proc/mounts && ! LC_ALL=C fgrep -q /initrd/loopfs /proc/mounts ; then
- if [ -e /initrd/dev/.devfsd ]; then
- umount /initrd/dev
- fi
- umount /initrd
- /sbin/blockdev --flushbufs /dev/ram0 >/dev/null 2>&1
-fi
-
if fgrep rhgb /proc/cmdline > /dev/null 2>&1 && [ "$BOOTUP" = "color" -a "$GRAPHICAL" = "yes" -a -x /usr/bin/rhgb ]; then
/usr/bin/rhgb
RHGB_STARTED=1
@@ -265,14 +256,19 @@ else
fsckoptions="-V $fsckoptions"
fi
-
_RUN_QUOTACHECK=0
ROOTFSTYPE=`awk '/ \/ / && ($3 !~ /rootfs/) { print $3 }' /proc/mounts`
if [ -z "$fastboot" -a "X$ROOTFSTYPE" != "Xnfs" -a "X$ROOTFSTYPE" != "Xnfs4" ]; then
STRING=$"Checking root filesystem"
echo $STRING
- initlog -c "fsck -T -a / $fsckoptions"
+ rootdev=`awk '/ \/ / && ($3 !~ /rootfs/) {print $1}' /proc/mounts`
+ if [ -b /initrd/"$rootdev" ] ; then
+ rootdev=/initrd/"$rootdev"
+ else
+ rootdev=/
+ fi
+ initlog -c "fsck -T -a $rootdev $fsckoptions"
rc=$?
if [ "$rc" = "0" ]; then
@@ -310,6 +306,15 @@ if [ -z "$fastboot" -a "X$ROOTFSTYPE" != "Xnfs" -a "X$ROOTFSTYPE" != "Xnfs4" ];
fi
fi
+# Unmount the initrd, if necessary
+if LC_ALL=C fgrep -q /initrd /proc/mounts && ! LC_ALL=C fgrep -q /initrd/loopfs /proc/mounts ; then
+ if [ -e /initrd/dev/.devfsd ]; then
+ umount /initrd/dev
+ fi
+ umount /initrd
+ /sbin/blockdev --flushbufs /dev/ram0 >/dev/null 2>&1
+fi
+
# Possibly update quotas if fsck was run on /.
LC_ALL=C grep -E '[[:space:]]+/[[:space:]]+' /etc/fstab | \
awk '{ print $4 }' | \