can't switch_root

Dutta, Kanishka kanishka.dutta at ti.com
Mon Oct 3 14:47:42 UTC 2011


When the system boots up, I am creating a new dir and mounting the separate partition on top of this
# mkdir newroot
# mount dev/mmcblk0p14 newroot

whole of system partition gets mounted on newroot successfully, after that, I give the command for switch_root :-

# switch_root newroot sbin/init
switch_root: failed to mount moving /dev to newroot/dev: Invalid argument
switch_root: forcing unmount of /dev
switch_root: failed to mount moving /proc to newroot/proc: Invalid argument
switch_root: forcing unmount of /proc
switch_root: failed to mount moving /sys to newroot/sys: Invalid argument
switch_root: forcing unmount of /sys
switch_root: failed to mount moving newroot to /: No such file or directory
switch_root: failed. Sorry.

Regards,
Kanishka Dutta
________________________________________
From: Laurent Bercot [ska-dietlibc at skarnet.org]
Sent: Monday, October 03, 2011 8:18 PM
To: busybox at busybox.net
Cc: Dutta, Kanishka
Subject: Re: can't switch_root

> Yes, initially I am booting up with minimal initramfs.

 Well in that case you cannot use pivot_root, and have to use switch_root
indeed.
 (You could also clean up your filesystem by hand and then mount --move,
but that offers no real benefit over using switch_root, which does exactly
that for you.)

 Could you send the output of a strace of your switch_root command ?

--
 Laurent


More information about the busybox mailing list