using switch_root to jump into unionfs?

Rob Landley rob at landley.net
Mon Mar 20 01:45:39 UTC 2006


On Sunday 19 March 2006 12:04 pm, Alexander Krause wrote:
> Hi all,
>
> i tried to use switch_root to jump into /vertex (mounted 2 dirs into it via
> unionfs)
>
> Well, my 60kB initrd does the following:
>
> 1. mount /dev/hda1
> 2. use a squashfs-image and mount it to /static
> 3. mount /dev/hda2 /dynamic
> 4. unite /static and /dynamic into /vertex
> 5. switch_root /vertex /bin/init
>
> Well, chrooting into /vertex workes fine, but switch root says:
> 'switch_root: not rootfs'
>
> its not because /bin/init, that one works (i've tried /bin/ash too).
>
> Any ideas? (i don't really wanna use pivot root cos i don't need the old
> root)
>
> cheers Alex

A) Right now switch_root tests that /init is a regular file (not a symlink).  
I just checked in a fix, try tonight's snapshot and see if that works better 
for you.

B) You can't use pivot_root from rootfs because rootfs can't be moved or 
unmounted; switch_root is for initramfs, and pivot_root is for initrd.

Rob
-- 
Never bet against the cheap plastic solution.



More information about the busybox mailing list