[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: pivot_root. unmount old root



>> I really wonder in which context this example (and also the other one
>> given
>> in the manpage) could work? Have you sucessfully tried it on your
>> system?
>
> No, I've never had occasion to.
> But where exactly is the failure occuring?
> Does the mount command fail?
> Does the pivot_root command fail?  Does exec chroot fail?

The umount command fails with "device is busy". privot root and chroot
work fine.

> Kill should be able to kill any process *except* init itself.
> And "telinit -u" should be able to refresh init.

I did a telinit u after the chroot and killed the remaining processes.
After that lsof doesn't show any open files under old-root but umount
still fails with "device is busy".

> Something like this occurs during boot with the transition from the
> initial
> RAM filesystem to the permanent root filesystem.  Perhaps you should
> study the scripts in /etc/rcS.d to find how the root file system is
> changed there.  Maybe that will give you some clues.

No, the transition from ramfs to the root filesystem isn't done by the
init scripts but by init itself. I issues a switch-root, that means all
contents from the ramfs is deleted and the root is mounted over with the
new root filesystem. I can't do that because the old rootfs is a normal
partition on a hard drive and the contents can't be simply deleted. So I
need to do some kind of pivot-root. Perhaps there is an alternative? The
problem atm is that it's not possible to unmount to old root fs.

K. Haselhorst


Reply to: