[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



05.08.2014 17:36, Zimmermann, Alexander wrote:

> 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:

Um.  The wrapper should be something like:

#! /bin/sh
echo mounts before-init:
mount
exec /sbin/init "$@"

The key point is, I think, the `exec' keyword.  Init should be started as pid=1.

> (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

But I see.  Busybox switch_root worked, ran your myinit, and the mount
in question - nfs mount - is still readonly like it should be...

Now this is really interrrrrrresting.

Do you have /etc/fstab entry for this mount?

Thanks,

/mjt


Reply to: