Subject: Re: PATCH: init(8) - multiuser under chroot
To: Alan Barrett <apb@cequrux.com>
From: Simon J. Gerraty <sjg@crufty.net>
List: tech-userlevel
Date: 09/08/2005 20:24:44
>On Mon, 05 Sep 2005, Simon J. Gerraty wrote:
>> If you are already chrooted the fsck and remount of / will fail
>> because the device is busy, using the actual raw device won't help.

>Yes, but the outer /etc/rc can do that before the chroot.  When the

Yes I know - that's why I'm advocating that ;-)

>> The kernel makes a speciall allowance for / to allow this operation at
>> boot but that won't work once you're chrooted.

>I can't find any code that prevents you from doing
>"mount -u -o ${options} /" as often as you like.

Yes but I was talking about the fsck and mount -o rw.
Try copying fsck, fstab etc into /tmp/root, then 
"chroot /tmp/root fsck /dev/wd0a"
assuming that's where / is mounted.

>> Attempting to remount the boot device within the chroot env would also
>> require some very scary changes to the kernel.

>Well, re-mounting the root device elsewhere (even without chroots)
>already gives an error.  Do chroots make this worse?

No, but they don't help either.

># mount -t ffs /dev/wd0a /
>mount_ffs: /dev/wd0a on /mnt: Device busy
># mount -t null / /mnt
>mount_null: / (/) and /mnt (/mnt) are not distinct paths

Yep.

--sjg