[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#756593: busybox's switch_root makes read-only NFS root read/write



Am 01.08.2014 um 13:46 schrieb Michael Tokarev <mjt@tls.msk.ru>:

> 01.08.2014 15:37, Zimmermann, Alexander wrote:
> 
>> As you can see, we use a vanilla 3.14 Kernel, patched w/ official AUFS patch (see
>> http://aufs.sourceforge.net)
> 
> I too use aufs here, for a very long time.  But I never tried
> nfs-root together with aufs, I used if in slightly different
> scenarios.
> 
>> To enable/disable AUFS we use a patched version of the root-ro script (see
>> https://help.ubuntu.com/community/aufsRootFileSystemOnUsbFlash) in our initramfs.
>> The script is located under /etc/initramfs-tools/scripts/init-bottom/. 
>> 
>>> Where do you set breakpoints?
>> 
>> To ensure that the root-to script isn’t the culprit, I disabled it (and therefore
>> AUFS too) via cmdline parameter root-ro=false and put a breakpoint right after
>> (break=init). At the breakpoint, the NFS mount was still ro.
>> 
>> I put another „breakpoint“ in /etc/rc3.d/S01* start script to verify the mount
>> right after switch_root. Here, the mount was already rw.
> 
> You can also write a small script - a wrapper for /sbin/init which will
> show you the mount info and exec /sbin/init, and run it with init=yourscript.

Despite the fact that I was unable to write a proper wrapper :-) - the kernel crashes - 
I know now that neither busybox nor AUFS is the culprit. See below:

(initramfs) mount
rootfs on / type rootfs (rw)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
udev on /root/dev type devtmpfs (rw,relatime,size=10240k,nr_inodes=2051439,mode=755)
devpts on /root/dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620)
tmpfs on /root/run type tmpfs (rw,nosuid,relatime,size=3282972k,mode=755)
192.168.0.10:/muclab/image/debian-sid on /root type nfs (ro,relatime,vers=3,rsize=65536,wsize=65536,namlen=255,hard,nolock,proto=tcp,port=2049,timeo=7,retrans=10,sec=sys,local_lock=all,addr=192.168.0.10)
(initramfs) exit
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
udev on /dev type devtmpfs (rw,relatime,size=10240k,nr_inodes=2051439,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620)
tmpfs on /run type tmpfs (rw,nosuid,relatime,size=3282972k,mode=755)
192.168.0.10:/muclab/image/debian-sid on / type nfs (ro,relatime,vers=3,rsize=65536,wsize=65536,namlen=255,hard,nolock,proto=tcp,port=2049,timeo=7,retrans=10,sec=sys,local_lock=all,addr=192.168.0.10)
Usage: init {-e VAR[=VAL] | [-t SECONDS] {0|1|2|3|4|5|6|S|s|Q|q|A|a|B|b|C|c|U|u}}
Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000100

CPU: 3 PID: 1 Comm: myinit Tainted: G          I   3.16.0.vanilla+ #1
Hardware name: NetApp, Inc. FAS3270/FAS3270, BIOS 5.2.1 03/07/2013
 ffff88043f8ebed8 ffffffff814b1e74 ffffffff815b4088 ffffffff814b152b
 ffff880400000010 ffff88043f8ebee8 ffff88043f8ebe80 0000000000000001
 0000000000000100 ffff88043f8e0358 ffffffff81659c00 00000000000141c0
Call Trace:
 [<ffffffff814b1e74>] ? dump_stack+0x41/0x51
 [<ffffffff814b152b>] ? panic+0xc1/0x1eb
 [<ffffffff8107c391>] ? do_exit+0xa01/0xa10
 [<ffffffff81085f7e>] ? recalc_sigpending+0xe/0x30
 [<ffffffff8107d27a>] ? do_group_exit+0x3a/0x110
 [<ffffffff8107d35b>] ? SyS_exit_group+0xb/0x10
 [<ffffffff814b6f6d>] ? system_call_fastpath+0x1a/0x1f
Kernel Offset: 0x0 from 0xffffffff81000000 (relocation range: 0xffffffff80000000-0xffffffff9fffffff)
---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000100

> 
>> Let me double check that AUFS is not broken. I try to boot a vanilla kernel.
>> I will come back to you w/ the results.
>> 
>> Alex
>> 
>> —-
>> As a side note, if we boot w/ AUFS, the mount points are right.
> 
> That's even more interesting :)
> 
> Thanks,
> 
> /mjt

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail


Reply to: