Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 24916 - baselayout-1.8.6.8-r1 update causes /dev/root to be displayed in df
Summary: baselayout-1.8.6.8-r1 update causes /dev/root to be displayed in df
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Martin Schlemmer (RETIRED)
URL:
Whiteboard:
Keywords:
: 25389 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-07-20 13:48 UTC by David Bergstein
Modified: 2003-07-28 19:18 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Bergstein 2003-07-20 13:48:56 UTC
Update to baselayout-1.8.6.8-r1.  After rebooting macihine, the root device when running "df", 
i.e., what is in /etc/mtab will no longer show the actual device name that the "/" directory is 
mounted in. 

Reproducible: Always
Steps to Reproduce:
1. emerge -u baselayout from previous version 
2. reboot machine 
3. root device will be displayed as /dev/root vs. /dev/hda1 or whatever the real device is. 


Expected Results:  
Correct name for root device should be shown in /etc/mtab. 

I was able to fix this problem in /etc/init.d/checkroot by commenting out the lines below: 
               # Create /etc/mtab 
               grep -v 'rootfs' /proc/mounts > /etc/mtab 
 
Adding these lines to /etc/init.d/checkroot before the ones pertaining to removing stale 
backups of /etc/mtab solved the issue (I'm sure other methods may also work): 
 
                # Clear mtab 
                > /etc/mtab 
                # Enter root filesystem into mtab 
                mount -f /
Comment 1 SpanKY gentoo-dev 2003-07-20 14:20:08 UTC
i'm pretty sure its a devfs thing 
Comment 2 David Bergstein 2003-07-20 16:23:19 UTC
This is actually an old problem with the content of /proc/mounts. 
 
You can see many entries on this subject in the online database at google.com: 
http://www.google.com/search?q=/dev/root%20/proc/mounts&ie=UTF-8&oe=UTF-8 
 
The checkroot script is taking the content of the /proc/mounts pseudofile and 
grepping out the line with rootdev in it, and replacing the contents of /etc/mtab with 
vague information.  The kernel generically refers to the root device as /dev/root in 
this file, due to some decisions made by the kernel programmers some time ago. 
 
I'm not sure if this issue is related to using devfs, which I am, but someone who is 
not should be able to see if it applies without devfs. 
Comment 3 Martin Schlemmer (RETIRED) gentoo-dev 2003-07-22 06:51:56 UTC
Fixed in CVS:

-----------------------------------------------------------
Index: ChangeLog
===================================================================
RCS file: /home/cvsroot/gentoo-src/rc-scripts/ChangeLog,v
retrieving revision 1.245
diff -u -B -r1.245 ChangeLog
--- ChangeLog	20 Jul 2003 01:31:41 -0000	1.245
+++ ChangeLog	22 Jul 2003 13:50:45 -0000
@@ -2,6 +2,10 @@
 # Copyright 2002-2003 Gentoo Technologies, Inc.; Distributed under the GPL
 # Written by Daniel Robbins (drobbins@gentoo.org)
 
+  22 Jul 2003; Martin Schlemmer <azarah@gentoo.org>:
+
+    Fix the /dev/root entry in /etc/mtab, bug #24916.
+
 * rc-scripts 1.4.3.9 (17 Jul 2003)
 
   17 Jul 2003; Martin Schlemmer <azarah@gentoo.org>:
Index: init.d/checkroot
===================================================================
RCS file: /home/cvsroot/gentoo-src/rc-scripts/init.d/checkroot,v
retrieving revision 1.31
diff -u -B -r1.31 checkroot
--- init.d/checkroot	11 May 2003 23:32:47 -0000	1.31
+++ init.d/checkroot	22 Jul 2003 13:50:46 -0000
@@ -61,8 +61,15 @@
 
 	if [ "${SOFTLEVEL}" = "boot" ]
 	then
+		#
 		# Create /etc/mtab
-		grep -v 'rootfs' /proc/mounts > /etc/mtab
+		#
+
+		> /etc/mtab
+		# Add the entry for / to mtab
+		mount -f /
+		# Make sure we do not have these in there
+		egrep -v '^(rootfs|/dev/root)' /proc/mounts >> /etc/mtab
 
 		# Remove stale backups
 		rm -f /etc/mtab~ /etc/mtab~~
Comment 4 Martin Schlemmer (RETIRED) gentoo-dev 2003-07-28 08:07:42 UTC
*** Bug 25389 has been marked as a duplicate of this bug. ***
Comment 5 Stephen 2003-07-28 19:18:20 UTC
Has this made it to stable yet? If it hasnt, do you know what version of baselayout it will be in so I will know when its safe for me to upgrade my server.