Need help to umount initrd and mount real file system

Denis Vlasenko vda.linux at googlemail.com
Tue Feb 6 17:14:20 UTC 2007


On Tuesday 06 February 2007 14:02, Rupesh Gujare wrote:
> hello all,
>  thanks for help..  and sorry for not stating my problem clearly
> so finally i was able to change rootfs.. Here is what i did at interactive shell by adding /bin/sh at start in /etc/init.d/rcS:--
> 
>  mount -t proc none /proc
>  mount -t ext2 /dev/sda1 /tmp
>  cd /tmp
>  umount /proc
>  pivot_root . tmp   #tmp exist on new-root
>  mount -t proc none /proc
>  exec chroot . /bin/ash <dev/console > dev/console 2>&1
>  exec chroot . /sbin/init <dev/console > dev/console 2>&1
>  umount /tmp
>  
> BUT HERE I GET ERROR AS:--
> Device or resource busy

Because your current directory is still "old" /
(== "new" /tmp)

>  Where I am going wrong?

Example that I posted:

echo "# Chrooting into root fs"
# we expect that /dev/console and /dev/null exist in /new_root/dev
cd /new_root
# making sure we dont keep /dev busy
exec <dev/console >dev/console 2>&1
# proc/ in new root is used here as a temp mountpoint for old root
pivot_root . proc

avoided that by changing to /new_root, detaching stdio from lod /dev
and doing pivot_root while sitting in /new_root.

Why you are not following the example?
--
vda



More information about the busybox mailing list