[Bug 440337] New: Strange problem related to chroot and mounts
https://bugzilla.novell.com/show_bug.cgi?id=440337 Summary: Strange problem related to chroot and mounts Product: openSUSE 11.1 Version: Factory Platform: Other OS/Version: Other Status: NEW Severity: Normal Priority: P5 - None Component: Kernel AssignedTo: bnc-team-screening@forge.provo.novell.com ReportedBy: robin.listas@telefonica.net QAContact: qa@suse.de Found By: --- I write this on recommendation from Josef Reidinger, on the factory list. Situation: I have 11.0 on one partition (I'll call this the host) and factory on another partition (I'll call this the guest). I order to upgrade factory I run "zypper dup", but I do so while running the "host" system, having the "guest" on a chroot. I believe I'm not the only one doing this trick that allows us to continue working wit a stable system while waiting hours (even days) for factory zypper dup to finish the upgrade. This worked well with 10.3 as the host and 11.0 as the guest, but fails with 11.0 as the host and 11.1 the guest. What I do is this: First, I run this script to prepare the chroot: #!/bin/bash mount /otros/test_d/ mount /otros/test_d/boot/ mount --bind /proc /otros/test_d/proc mount --bind /sys /otros/test_d/sys mount --bind /dev /otros/test_d/dev cp -f /etc/resolv.conf /otros/test_d/etc/resolv.conf echo echo " Copy paste the next line to activate prompt change:" echo "export PS1=$'\\[\E[1m\E[31m\\]NOT_\\h:\\w # \\[\E(B\E[m\\]'" echo chroot /otros/test_d/ /bin/bash --login Then I run "zypper dup" inside. The first clue of a problem was this: ... ... Installing: kernel-pae-base-2.6.27.3-2.1 [error] Installation of kernel-pae-base-2.6.27.3-2.1 failed: (with --nodeps --force) Error: Subprocess failed. Error: RPM failed: Setting up /lib/modules/2.6.27.3-2-pae Scanning scripts ... Resolve dependencies ... Install symlinks in /lib/mkinitrd/setup ... Install symlinks in /lib/mkinitrd/boot ... Kernel image: /boot/vmlinuz-2.6.27.3-2-pae Initrd image: /boot/initrd-2.6.27.3-2-pae Root device: /dev/disk/by-id/ata-ST3160021A_5JS4VV1F-part14 (/dev/hdd14) (mounted on / as reiserfs) Resume device: /dev/hda5 WARNING Cannot determine dependencies of kernel module 'pata_acpi'. Does it exist? If it does, try depmod -a. Continuing without pata_acpi. WARNING Cannot determine dependencies of kernel module 'ata_generic'. Does it exist? If it does, try depmod -a. Continuing without ata_generic. WARNING Cannot determine dependencies of kernel module 'ide_pci_generic'. Does it exist? If it does, try depmod -a. Continuing without ide_pci_generic. Kernel Modules: dock scsi_mod libata ata_piix edd usbcore ohci-hcd uhci-hcd ehci-hcd Features: block usb resume.userspace resume.kernel Bootsplash: openSUSE (1024x768) 22200 blocks /boot directory is not mounted error: %post(kernel-pae-base-2.6.27.3-2.1.i586) scriptlet failed, exit status 1 Abort, retry, ignore? [A/r/i]: a Which is false, /boot is mounted with correct files inside. Josef noticed that the guest /boot partition was not listed in /etc/mtab, and thus the kernel script was failing. Look: nimrodel:~ # mount | grep otros/test_d /dev/hdd14 on /otros/test_d type reiserfs (rw,noatime,nodiratime,acl,user_xattr) /dev/hda8 on /otros/test_d/boot type ext2 (rw,noatime,nodiratime,acl,user_xattr) /proc on /otros/test_d/proc type none (rw,bind) /sys on /otros/test_d/sys type none (rw,bind) /dev on /otros/test_d/dev type none (rw,bind) So, boot is there, mounted. However, when I chroot, boot dissapears: nimrodel:~ # chroot /otros/test_d/ /bin/bash --login nimrodel:/ # mount /dev/hdd14 on / type reiserfs (rw,acl,user_xattr) /proc on /proc type proc (rw) sysfs on /sys type sysfs (rw) debugfs on /sys/kernel/debug type debugfs (rw) udev on /dev type tmpfs (rw) devpts on /dev/pts type devpts (rw,mode=0620,gid=5) securityfs on /sys/kernel/security type securityfs (rw) And notice that /proc/mount is not usable for this because it contains the host data: NOT_nimrodel:~ # cat /proc/mounts | grep boot /dev/hda6 /boot ext2 rw,noatime,nodiratime,errors=continue,user_xattr,acl 0 0 /dev/hdd2 /otros/boot_d1 ext2 rw,noatime,nodiratime,errors=continue 0 0 /dev/hdd3 /otros/boot_d2 ext2 rw,noatime,nodiratime,errors=continue 0 0 /dev/hda7 /otros/boot_a2 ext2 rw,noatime,nodiratime,errors=continue,user_xattr,acl 0 0/dev/hda8 /otros/boot_a3 ext2 rw,noatime,nodiratime,errors=continue,user_xattr,acl 0 0 /dev/hda8 /boot ext2 rw,noatime,nodiratime,errors=continue,user_xattr,acl 0 0 The "hack" I'm using is, run this on the host: nimrodel:~ # cat /etc/mtab | grep /otros/test_d/boot /dev/hda8 /otros/test_d/boot ext2 rw,noatime,nodiratime,acl,user_xattr 0 0 And edit and append to guest /etc/mtab: echo "/dev/hda8 /boot ext2 rw,noatime,nodiratime,acl,user_xattr 0 0" >> /etc/mtab With this, the chrooted guest, factory, is happily running "zypper dup" right now. Josef Reidinger (suse@cz) says:
Interesting, then it must be kernel bug, because when I test this on OpenSUSE 11 it is correct. in chroot it show mounted thinks, but with prefix /mounts/something/boot so it is not problem and correctly mounted under chroot is show as /boot. Please open bug on kernel.
So here you have! :-) -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=440337
User chrubis@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=440337#c1
Cyril Hrubis
https://bugzilla.novell.com/show_bug.cgi?id=440337
User jreidinger@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=440337#c2
Josef Reidinger
https://bugzilla.novell.com/show_bug.cgi?id=440337
User robin.listas@telefonica.net added comment
https://bugzilla.novell.com/show_bug.cgi?id=440337#c3
Carlos Robinson
https://bugzilla.novell.com/show_bug.cgi?id=440337
User jreidinger@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=440337#c4
Josef Reidinger
https://bugzilla.novell.com/show_bug.cgi?id=440337
User jreidinger@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=440337#c5
Josef Reidinger
https://bugzilla.novell.com/show_bug.cgi?id=440337
User robin.listas@telefonica.net added comment
https://bugzilla.novell.com/show_bug.cgi?id=440337#c6
--- Comment #6 from Carlos Robinson
https://bugzilla.novell.com/show_bug.cgi?id=440337
User jreidinger@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=440337#c7
--- Comment #7 from Josef Reidinger
An alternative would be a script that created the correct entries in mtab.
The other day factory crashed, and I saw later that mtab contained some other mounts I had at the time of the crash and were incorrect. Thus, what I do now is always edit the mtab file as part of the procedure. If that could be automated, it would be fantastic, and if it not, I'll just continue with joe :-)
Now I add enviromental variable, which allow skip this test. s oonly you need export this var. name you can get if this check fail :)...now it is in svn and will be in next release. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=440337
User jreidinger@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=440337#c8
Josef Reidinger
https://bugzilla.novell.com/show_bug.cgi?id=440337
User robin.listas@telefonica.net added comment
https://bugzilla.novell.com/show_bug.cgi?id=440337#c9
Carlos Robinson
https://bugzilla.novell.com/show_bug.cgi?id=440337
User jreidinger@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=440337#c10
Josef Reidinger
participants (1)
-
bugzilla_noreply@novell.com