Bug 82685 - rc.sysinit fails with fsck on NFS-based root filesystem
rc.sysinit fails with fsck on NFS-based root filesystem
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: initscripts (Show other bugs)
8.0
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Bill Nottingham
Brock Organ
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2003-01-24 16:00 EST by Oliver Scheck
Modified: 2014-03-16 22:33 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2003-01-24 17:32:36 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Patch to correct the bug. (396 bytes, patch)
2003-01-24 16:06 EST, Oliver Scheck
no flags Details | Diff

  None (edit)
Description Oliver Scheck 2003-01-24 16:00:33 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i586; en-US; rv:1.2) Gecko/20021203

Description of problem:
rc.sysinit tries to execute fsck.nfs if the root filesystem is on NFS.

The check for an NFS root filesystem is incorrect in rc.sysinit because
a Linux 2.4.x kernel has *two* entries in /proc/mounts for / e.g.:

rootfs / rootfs rw 0 0
/dev/root / ext3 rw 0 0

To correct this behaviour apply the following patch:

--- rc.sysinit.orig	2003-01-24 19:12:37.000000000 +0100
+++ rc.sysinit	2003-01-24 19:19:54.000000000 +0100
@@ -230,7 +230,7 @@
  
 
 _RUN_QUOTACHECK=0
-ROOTFSTYPE=`awk '/ \/ / { print $3 }' /proc/mounts`
+ROOTFSTYPE=`awk '/ \/ / && ($3 !~ /rootfs/) { print $3 }' /proc/mounts`
 if [ -z "$fastboot" -a "X$ROOTFSTYPE" != "Xnfs" ]; then 
 
         STRING=$"Checking root filesystem"
@@ -302,7 +302,7 @@
 fi
 
 # Remount the root filesystem read-write.
-state=`awk '/(^\/dev\/root| \/ )/ { print $4 }' /proc/mounts`
+state=`awk '/ \/ / && ($3 !~ /rootfs/) { print $4 }' /proc/mounts`
 [ "$state" != "rw" ] && \
   action $"Remounting root filesystem in read-write mode: " mount -n -o
remount,rw /
 


Version-Release number of selected component (if applicable):
initscripts-6.95-1

How reproducible:
Always

Steps to Reproduce:
1. Rebuild linux kernel for root filesystem on NFS
2. Boot system
    

Actual Results:  fsck.nfs: No such file or directory

Expected Results:  No file system check for NFS root filesystem.

Additional info:
Comment 1 Oliver Scheck 2003-01-24 16:06:34 EST
Created attachment 89590 [details]
Patch to correct the bug.
Comment 2 Oliver Scheck 2003-01-24 16:09:10 EST
Comment on attachment 89590 [details]
Patch to correct the bug.

--- rc.sysinit.orig	2003-01-24 19:12:37.000000000 +0100
+++ rc.sysinit	2003-01-24 19:19:54.000000000 +0100
@@ -230,7 +230,7 @@


 _RUN_QUOTACHECK=0
-ROOTFSTYPE=`awk '/ \/ / { print $3 }' /proc/mounts`
+ROOTFSTYPE=`awk '/ \/ / && ($3 !~ /rootfs/) { print $3 }' /proc/mounts`
 if [ -z "$fastboot" -a "X$ROOTFSTYPE" != "Xnfs" ]; then 

	 STRING=$"Checking root filesystem"
@@ -302,7 +302,7 @@
 fi

 # Remount the root filesystem read-write.
-state=`awk '/(^\/dev\/root| \/ )/ { print $4 }' /proc/mounts`
+state=`awk '/ \/ / && ($3 !~ /rootfs/) { print $4 }' /proc/mounts`
 [ "$state" != "rw" ] && \
   action $"Remounting root filesystem in read-write mode: " mount -n -o
remount,rw /
Comment 3 Bill Nottingham 2003-01-24 17:32:36 EST
Fixed, will be in next build (7.05-1)

Note You need to log in before you can comment on or make changes to this bug.