Bug 82685

Summary: rc.sysinit fails with fsck on NFS-based root filesystem
Product: [Retired] Red Hat Linux Reporter: Oliver Scheck <scheck>
Component: initscriptsAssignee: Bill Nottingham <notting>
Status: CLOSED RAWHIDE QA Contact: Brock Organ <borgan>
Severity: medium Docs Contact:
Priority: medium    
Version: 8.0CC: rvokal
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2003-01-24 22:32:36 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Patch to correct the bug. none

Description Oliver Scheck 2003-01-24 21:00:33 UTC
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 21:06:34 UTC
Created attachment 89590 [details]
Patch to correct the bug.

Comment 2 Oliver Scheck 2003-01-24 21:09:10 UTC
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 22:32:36 UTC
Fixed, will be in next build (7.05-1)