Im not sure if this is intentional or not but with the new version of genkernel my / volume is mounted twice. # mount /dev/hda8 on / type reiserfs (rw,noatime,notail) /dev/hda8 on / type reiserfs (rw,noatime) none on /proc type proc (rw) none on /sys type sysfs (rw) none on /dev type devfs (rw) none on /dev/pts type devpts (rw) none on /dev/shm type tmpfs (rw) none on /proc/bus/usb type usbfs (rw) Reproducible: Always Steps to Reproduce: 1.compiled kernel with genkernel all --menuconfig --clean --mrproper --bootsplash 2. 3. Actual Results: compiled kernel and initrd, no error messages on bootup on in genkernel.log Relevant files can be accessed at http://www.dslextreme.com/users/rockhound/genbug/
I have this same issue; here is my grub conf... title Gentoo kernel (hd0,5)/boot/vmlinuz root=/dev/ram0 init=/linuxrc real_root=/dev/hda7 devfs=mount acpi=ht resume=/dev/hda8 splash=silent vga=788 initrd (hd0,5)/boot/initrd
Same here; this is my grub.conf: title Gentoo kernel (hd0,5)/boot/vmlinuz root=/dev/ram0 init=/linuxrc real_root=/dev/hda7 devfs=mount acpi=ht resume=/dev/hda8 splash=silent vga=788 initrd (hd0,5)/boot/initrd
Same thing occurs with a normal lilo.conf install as well, using: root=/dev/ram0 append "real_root=/dev/hdX#.... " By 'normal', I mean it is otherwise consistent with the current install document.
yes, I have no idea why. I actually think it's a baselayout issue in the rc-scripts. It does not appear to affect anything though :/
It does affect something. On shutdown, it tries to umount / 2x, resulting in an error and interrupting the shutdown proceedure (prompting for a root password or Ctrl-D). See http://bugs.gentoo.org/show_bug.cgi?id=33271.
I'm 99.9% positivie that only occurs if you have Automount devfs at boot turned on, as I am able to reproduce it with that on, but not with it off. -Brad
I too see the double root mount with the mount command but only mounted once in proc mounts. What I see though is that the '/' mount point is mounted without using the options specified in /etc/fstab my root fstab entry looks like this: /dev/sda2 / xfs noatime,logbufs=8,logbsize=32k 0 1 while my mount command reports: /dev/sda2 on / type xfs (rw,noatime,logbufs=8,logbsize=32k) /dev/sda2 on / type xfs (rw,noatime) and /proc/mounts contains: rootfs / rootfs rw 0 0 /dev/root /tmp/.initrd ext2 rw 0 0 /dev/sda2 / xfs rw,noatime 0 0
Created attachment 25969 [details] Kernel config I also have this double mount problem, even with latest stable genkernel. It is not due to automounting of devfs, it is disabled in my kernel configuration. I am attaching my kernel configuration file. Here is what my mount shows: /dev/hda3 on / type reiserfs (rw,noatime) /dev/hda3 on / type reiserfs (rw,noatime) none on /proc type proc (rw) none on /dev type devfs (rw) none on /dev/shm type tmpfs (rw) none on /proc/bus/usb type usbfs (rw) It does not seem to cause problem at runtime, but at shotdown, it does not power down or reboot automatically, teh shutdown procedure just stops and it asks for root password (for maintenance or something) or pressing CTRL-D. It is quite annoying.
Just to add to this, I'm seeing the same root mounted twice problem (once without the right options, once with), with genkernel's default 2.4 kernel config, and latest stable versions of everything from grub.conf: root (hd0,3) kernel (hd0,1)/kernel-2.4.22-gentoo-r7 root=/dev/ram0 real_root=/dev/hda4 init=/linuxrc vga=0x317 acpi=off initrd (hd0,1)/initrd-2.4.22-gentoo-r7 from fstab: /dev/hda4 / ext3 defaults 0 0 from /proc/mounts: rootfs / rootfs rw 0 0 /dev/root /tmp/.initrd ext2 rw 0 0 none /tmp/.initrd/dev devfs rw 0 0 from df: /dev/hda4 11139884 5204728 5369268 50% / /dev/hda4 11139884 5204728 5369268 50% / [Though I've got a probably caused-by-me issue to look at here as well.... root is supposed to be an ext3 partition and its being mounted ext2 during boot :( ]
I had the same problem with my ext3 mounting as ext2, turns out compiling ext3 into the kernel (not as a module) fixed that problem. Though I still have the issue with the double mounted root. Also not sure if this second piece is related, though this all seems to be related to bugs in the startup scripts generated by genkernel, it seems that the /tmp/.initrd mount never unmounts during boot, because the kernel is using it for access to the console device. electro root # lsof | grep initrd keventd 2 root 0u CHR 5,1 56 /tmp/.initrd/dev/console keventd 2 root 1u CHR 5,1 56 /tmp/.initrd/dev/console keventd 2 root 2u CHR 5,1 56 /tmp/.initrd/dev/console ksoftirqd 3 root 0u CHR 5,1 56 /tmp/.initrd/dev/console ksoftirqd 3 root 1u CHR 5,1 56 /tmp/.initrd/dev/console ksoftirqd 3 root 2u CHR 5,1 56 /tmp/.initrd/dev/console kswapd 4 root 0u CHR 5,1 56 /tmp/.initrd/dev/console kswapd 4 root 1u CHR 5,1 56 /tmp/.initrd/dev/console kswapd 4 root 2u CHR 5,1 56 /tmp/.initrd/dev/console bdflush 5 root 0u CHR 5,1 56 /tmp/.initrd/dev/console bdflush 5 root 1u CHR 5,1 56 /tmp/.initrd/dev/console bdflush 5 root 2u CHR 5,1 56 /tmp/.initrd/dev/console kupdated 6 root 0u CHR 5,1 56 /tmp/.initrd/dev/console kupdated 6 root 1u CHR 5,1 56 /tmp/.initrd/dev/console kupdated 6 root 2u CHR 5,1 56 /tmp/.initrd/dev/console kjournald 7186 root 0u CHR 5,1 56 /tmp/.initrd/dev/console kjournald 7186 root 1u CHR 5,1 56 /tmp/.initrd/dev/console kjournald 7186 root 2u CHR 5,1 56 /tmp/.initrd/dev/console kjournald 17634 root 0u CHR 5,1 56 /tmp/.initrd/dev/console kjournald 17634 root 1u CHR 5,1 56 /tmp/.initrd/dev/console kjournald 17634 root 2u CHR 5,1 56 /tmp/.initrd/dev/console kjournald 19277 root 0u CHR 5,1 56 /tmp/.initrd/dev/console kjournald 19277 root 1u CHR 5,1 56 /tmp/.initrd/dev/console kjournald 19277 root 2u CHR 5,1 56 /tmp/.initrd/dev/console kjournald 22702 root 0u CHR 5,1 56 /tmp/.initrd/dev/console kjournald 22702 root 1u CHR 5,1 56 /tmp/.initrd/dev/console kjournald 22702 root 2u CHR 5,1 56 /tmp/.initrd/dev/console kjournald 23496 root 0u CHR 5,1 56 /tmp/.initrd/dev/console kjournald 23496 root 1u CHR 5,1 56 /tmp/.initrd/dev/console kjournald 23496 root 2u CHR 5,1 56 /tmp/.initrd/dev/console kjournald 24026 root 0u CHR 5,1 56 /tmp/.initrd/dev/console kjournald 24026 root 1u CHR 5,1 56 /tmp/.initrd/dev/console kjournald 24026 root 2u CHR 5,1 56 /tmp/.initrd/dev/console khubd 31926 root 0u CHR 5,1 56 /tmp/.initrd/dev/console khubd 31926 root 1u CHR 5,1 56 /tmp/.initrd/dev/console khubd 31926 root 2u CHR 5,1 56 /tmp/.initrd/dev/console
actually as of _beta12, it should properly umount the initrd, we're redirecting console earlier on, which fixed that problem. We just released _rc2 today, which seems to have fixed everything except the double mount. The thing is it's not really double mounted if you look in /proc/mounts, /etc/mtab just thinks it is, so I need to debug that.
I've just built the new genkernel, and I still have this problem. Genkernel reports this version: # genkernel GenKernel 3.0.1_rc2 [options] command [snip] A df shows: Filesystem 1K-blocks Used Available Use% Mounted on /dev/md2 1951744 1352328 599416 70% / /dev/md2 1951744 1352328 599416 70% / plus the OK other file systems, but /proc/mounts shows: rootfs / rootfs rw 0 0 /dev/root /tmp/.initrd ext2 rw 0 0 /dev/md2 / reiserfs rw,noatime 0 0 plus other file systems I've built the kernel with automount of /dev off, as per the genkernel readme.
please stop adding reports to this entry unless you have a fix I will close it when it's fixed .... we are aware of the double-mount entry in /etc/mtab (which is what shows when you run 'mount' without parameters). We do not yet have a solution. Thank you
*** Bug 42903 has been marked as a duplicate of this bug. ***
Brad, What about the shutdown problem (with unmount) (see comments 5 & 8)? Is this addressed in this bug report or should I file it as another bug? I am asking because you never commented directly on the shutdown issue.
At least on my system, the shutdown problem has disappeared with a recent Portage snapshot.
being fully up-to-date, I can still see the shutdown problem, it gives error message saying something about remounting (?) and asks for password or CTRL-D. If I do not do anything, it shutdown the system within few seconds as asked (meaning that it does not just wait for input forever).
Hm... mysterious. I don't have this anymore, but I don't know when and how it disappeared.
I thought I addressed it. Basically, it ONLY occurs if you have automount at boot turned on for devfs. That MUST be turned off. That is the only cause I have ever seen for that issue.
Where do you turn automount on and off? In /etc/fstab? I ask because I have followed the install doc all the time, so I have nothing changed, but it disappeared at once.
The issue at hand is that /etc/init.d/checkroot forces a mount of / after creation of /etc/mtab via a 'mount -f /' which seems unnecessary because prior to that there's a mount of / via the remount option. I commented out the 'mount -f /' at line 105, and this fixed the double mount issue. If the mount -f / is really required, then it might be beneficial to add the -o remount option to that as well!
>I thought I addressed it. >Basically, it ONLY occurs if you have automount at boot turned on >for devfs. That MUST be turned off. >That is the only cause I have ever seen for that issue. So you can fix it! I'm hoping to create a framework for checking for sane kernel configs, but in the mean time a quick awk through the .config file is all that is needed. search for start of file CONFIG_STARTDEVFS or whatever it is (start of file is a carrot? ^??) and replace all ocurences with #CONFIG_STARTDEVFS part of what the framework is supposed to do, is deal with the upcomming genkernel interactive mode (either in a fork or mainline depending on if my patches get accepted or even discussed) and deal with what options are currently being made, if it's a noinitrd/busybox or whatever occurance, (I hate my spell checker), what's needed will be different (I presume)
As for as the shutdown issue, I do not have automonting of devfs enabled, I have rebuilt my kernel just to make sure, but I still get error message at shutdown (Unmounting fails and I get "Remounting remaining filesystems readonly" message). At that point mount says that root partition is mounted (twice) and it also sees /proc and /dev as mounted. I have tried MKI's solution, it seems to work (root partition is finally mounted just once), but strangely it does not solve the shutdown issue for me. I have also used tried different kernel which compiled some time ago manually (no initrd) and had no problem at shutdown, so it looks like it is a genkernel problem.
Brad, This problem may after all be really related to busybox's ash not correctly closing the open filedescriptors for /dev/console upon the exec with fd redirection? Almost as though the filedescriptors did not have FD_CLOEXEC set. We tested a barebones linuxrc which simply mounted the filesystem, pivot_root'd and then called chroot with redirection for dev/console and even _that_ failed to allow unmounting of the initrd image because all kernel threads were at that point using the dev/console off of the initrd image instead of the filesystem. (busybox-1.00-pre7)
[[ Reassigning ]]
MKI thanks for tracking down the double-mount issue, it should definatly have -o remount in there, as /etc/fstab may have different options for mounting, than when the initrd mounts the root. As far as not closing down filedescriptors at exec, that's odd, as I do not believe I'm seeing that here, though I am on AMD64 ... I'll see if I can get azarah to commit the baselayout fix for the double-mount issue. Thanks for your help! -Brad
*** Bug 43457 has been marked as a duplicate of this bug. ***
Brad, I just installed another system (portage sync'd earlier today during install) and got bit by the initrd not unmounting issue. After some googling and mucking with the initrd image, I found out that the issue was really the 2.4.22 kernel (gentoo-sources branch). The bug is that the kernel never follows init's fd set (/dev/tty, /dev/console) as it should. The default ebuild gentoo-sources-2.4.22-r7.ebuild really needs to be patched to include the fix for the fd problem, so as to save all the other poor souls the hassle of figuring this out. I've included the patch below (the double mount of / still remains however in baselayout): --->8---cut-here---8<--- --- kernel/fork.c.old 2004-03-17 20:17:54.000000000 -0700 +++ kernel/fork.c 2004-03-17 19:17:42.000000000 -0700 @@ -572,7 +572,7 @@ /* This can race but the race causes us to copy when we don't need to and drop the copy */ - if(atomic_read(&files->count) == 1) + if(atomic_read(&files->count) == 1 || (current->pid == 1)) { atomic_inc(&files->count); return 0; --->8---cut-here---8<--- And here's the fix for baselayout's /etc/init.d/checkroot: --- init.d/checkroot.old 2004-03-17 20:22:28.000000000 -0700 +++ init.d/checkroot 2004-03-17 20:39:04.000000000 -0700 @@ -80,9 +80,9 @@ > /etc/mtab # Add the entry for / to mtab - mount -f / + mount -f -o remount / # Make sure we do not have these in there - egrep -v '^(rootfs|/dev/root)' /proc/mounts >> /etc/mtab + awk '{ if ($2 != "/" && $3 != "rootfs") print $0; }' /proc/mounts >> /etc/mtab # Now make sure /etc/mtab have additional info (gid, etc) in there for x in $(awk '{ print $2 }' /proc/mounts | uniq) do --->8---cut-here---8<--- -mohan
kernel issue, not base-system's removing from cc
I applied the patch to checkroot and it does resolve the problem of having root mounted twice. However, /tmp/.initrd is still mounted because /tmp/.initrd/dev/console is still being held open by kernel processes 2-6,8 (ksoftirqd, events, kblockd, pdflush(x2) and aio) and /tmp/.initrd/dev could not be umounted. Still, it's better than before (no error on reboot, laptop mode now works, etc.), and if I really don't like it I can go without the initrd and boot without it successfully... Still, it would be nice to have a resolution for this one. I'm using genkernel-3.0.1, built on 20040304 from a portage snapshot from either that day or the previous one.
Reassigning this back to the Base System team since this is an issue with baselayout. The patch for /etc/init.d/checkroot [ ignore the kernel patch ] is in comment #28. MKI: You might want to send that kernel patch upstream, since it is a problem in the vanilla sources. See http://bugme.osdl.org. The issue is solved in genkernel-3.0.2_rc1 without the need of a patch.
*** Bug 44601 has been marked as a duplicate of this bug. ***
Tim, are you sure that the issue has been resolved in genkernel-3.0.2_rc1? I'm using genkernel-3.0.2 (final) with the gentoo-dev-sources kernel, and the problem still exists (with none of the patches mentioned here): # df -k Filesystem 1K-blocks Used Available Use% Mounted on /dev/hde6 8007288 2623396 5383892 33% / /dev/hde6 8007288 2623396 5383892 33% / /dev/hde2 77772 7232 66524 10% /boot /dev/hde7 4069096 1304304 2554744 34% /usr/portage none 258072 0 258072 0% /dev/shm
Yeah, you still need the patch for fork.c at the beginning of comment #28. Please try, for me it worked.
The problem for the /tmp/.initrd issue has been fixed in genkernel 3.0.2_rc1; that was a genkernel issue. But; I don't maintain basesystem which contains the double root [/] bug; so this is still an open non-genkernel issue.
agriffis, this is one of the bugs you need to keep track of for 2004.1. I personally experienced this when building test-iso's for 2004.1. The 2.4.24-xfs-r3 just works fine, while 2.6.3-gentoo-dev-r3 prints that nasty "press ctrl+d..."-Message on shutdown.
Created attachment 28842 [details, diff] Correct patch for checkroot I think this is the correct patch for checkroot. If you add -o remount then you've missed the point. The problem is that we only want one listing in /etc/mtab for the root filesystem. The listing that we want is the one that is generated from mount -f /. So first we clear the mtab. Then we add the correct listing with mount -f / (if you use -o remount then it won't add the line at all). Finally we add in other filesystems from /proc/mounts, excluding any root listings. The old code for that was buggy; I think the new code will work correctly.
Created attachment 28902 [details, diff] Correct patch for checkroot (try #2) Small but important change... beejay is already testing this update
Fixed on a Gentoo-2004.1 Beta-LiveCD (internal testing) / is mounted only once now.
Fixed in baselayout-1.8.8
I've read through this log and have been experiencing similar symptoms. At shutdown, I get "Remounting remaining filesystems read-only... Give root password for maintenance..." My system is up to date (just synced it and emerged the "world"). What I found to cause my problem is /initrd . It appears that the initrd is being remounted to /initrd during boot as /dev/rood.old . This filesystem can't be unmount as it has many files that are in use. When "Remounting remaining..." at shutdown tries to remount /dev/root.old it fails. To resolve this, I booted off of CD and deleted the directory (I originally created it to resolve a boot error regarding "/initrd not found"). With /initrd in place, /etc/mtab shows this: /dev/md/0 / ext3 rw,noatime 0 0 /dev/root.old /initrd ext2 rw 0 0 proc /initrd/proc proc rw 0 0 none /proc proc rw 0 0 none /dev devfs rw 0 0 /dev/vg/usr /usr reiserfs rw,noatime 0 0 /dev/vg/home /home reiserfs rw,noatime 0 0 /dev/vg/opt /opt reiserfs rw,noatime 0 0 /dev/vg/var /var reiserfs rw,noatime 0 0 /dev/vg/tmp /tmp reiserfs rw,noatime 0 0 none /dev/shm tmpfs rw 0 0 none /proc/bus/usb usbfs rw 0 0 Notice lines 2 and 3 of /etc/mtab--/dev/root.old and proc are being mounted into /initrd. I still have this problem after "emerge sync" and "emerge -u world"--was this an issue address with the fixes mentioned in this bug?
Thomas, I think the problem you're seeing is different from what we resolved in this bug. Please put it in a new bug and we'll chase it there. Thanks!