Need help to umount initrd and mount real file system
Rupesh Gujare
rupesh_gujare at rediffmail.com
Tue Feb 6 13:02:16 UTC 2007
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
Where I am going wrong?
I am compiling busybox with shared library as a dynamically linked.
Is it problem with /dev/sda1? ie. i am referencing to /dev/sda1 on old root FS(if it's like that, then how to overcome it?). or with shared libraries on old FS?
your help is greatly appreciated..
Thanks in advance..
Rupesh Gujare.
On Tue, 06 Feb 2007 Denis Vlasenko wrote :
>On Monday 05 February 2007 15:11, Rupesh Gujare wrote:
> >
> > I had tried with pivot_root:
> > I entered
> > /bin/sh in /etc/rcS
> > and after mounting /proc tried to do pivot_root
> > it gives me
> > pivot_root:pivot_root: Device or resource busy.
> > any clue why it is like this?
>
>Oh, wonderful problem report. No solid info on what exactly
>you did (params to pivot_root etc...).
>
>Anyway, a part of my homemade initrd whcu does pivot_root
>(bu this time "new" rootfs is mounted on /new_root):
>
>
># Clean up
>#umount /sys
>umount /proc
>
>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 || {
> echo "pivot_root failed. Fatal, cannot continue booting"
> while true; do sleep 32000; done
>}
>
>exec \
>chroot . \
>sh -c '\
>umount -n /proc || { echo "! error unmounting initrd fs, continuing"; sleep 10; }
>exec /bin/env - /sbin/init
>'
>
>echo "chroot . sh failed. Fatal, cannot continue booting"
>while true; do sleep 32000; done
>
>
>Hope this helps
>--
>vda
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.busybox.net/pipermail/busybox/attachments/20070206/b2767cc4/attachment-0001.htm
More information about the busybox
mailing list