Jarry wrote, at 11/11/2011 09:37 PM:
> Hi,
> this is actually not problem but rather a matter of customs:
> My new fresh installed system shows root-fs in "df" as
> /dev/root, not actuall device (in my case /dev/md2).
>
> I think I coud get used to it, but some software still needs
> /dev/md2 (i.e. lilo), other does not find /dev/md2 anymore
> and needs /dev/root to work properly (i.e. monit).
>
> Moreover, in /etc/fstab I still have to use /dev/md2 as root
> filesystem, while /etc/mtab shows only /dev/root.
>
> I do not like such a mess and I'd like to put it in rather
> consistent state where root filesystem has always the same
> and only name. Is there some way to stop this renaming
> of root filesystem to /dev/root and let it be as in old
> baselayout1?
>
> Jarry

try that patch (attached):

sometime ago i have found it in gentoo forums. probably did few modifications in
the original i found, cannot remember. it works for me for months with no
visible problems

victor
--- mtab.orig	2011-05-09 10:39:38.510430618 +0400
+++ /etc/init.d/mtab	2011-11-12 15:23:23.113980922 +0400
@@ -12,6 +12,9 @@
 
 start()
 {
+	# look in an easy way to where root is mounted from
+	ROOTFS=$(readlink -f /dev/root)
+
 	# /etc/mtab could be a symlink to /proc/mounts
 	if [ ! -w /etc/mtab -a -L /etc/mtab ]; then
 		eeinfo "Skipping mtab update (non writeable symlink)"
@@ -28,7 +31,8 @@
 	# makes / readonly and dismounts all tmpfs even if in use which is
 	# not good. Luckily, umount uses /etc/mtab instead of /proc/mounts
 	# which allows this hack to work.
-	grep -v "^[^ ]* / tmpfs " /proc/mounts > /etc/mtab
+	grep -v "^[^ ]* / tmpfs " /proc/mounts |
+		awk '$1 != "rootfs" {print}' | sed 's%/dev/root%'${ROOTFS}'%' > /etc/mtab
 
 	# Remove stale backups
 	rm -f /etc/mtab~ /etc/mtab~~

Reply via email to