Subject: Re: PATCH: init(8) - multiuser under chroot
To: Simon J. Gerraty <>
From: Lubomir Sedlacik <>
List: tech-userlevel
Date: 09/09/2005 15:11:19
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Thu, Sep 08, 2005 at 08:24:44PM -0700, Simon J. Gerraty wrote:
> >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 ;-)

i uploaded my ramdisk scripts and the patches to:

i use them for few months on my laptop with / on cgd(4):

 /dev/cgd0a on / type ffs (noatime, nodevmtime, soft dependencies, local)

 Filesystem         Size      Used     Avail Capacity  Mounted on
 /dev/cgd0a          36G      24G       12G    66%     /


 Device      512-blocks     Used    Avail Capacity  Priority
 /dev/cgd1a     1050273    81632   968641     8%    0

> > > 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.

the system in my chroot has no / file system in /etc/fstab, to avoid
unnecessary fsck runs, mount -a, etc.  i also disabled savecore, since
it doesn't make much sense in such setup (swap is also on cgd(4) with a
random key so it's unreadable after reboot).


-- Lubomir Sedlacik <salo@{NetBSD,Xtrmntr,silcnet}.org>   --

Content-Type: application/pgp-signature
Content-Disposition: inline

Version: GnuPG v1.2.6 (NetBSD)