Subject: Re: PATCH: init(8) - multiuser under chroot
To: Simon J. Gerraty <sjg@crufty.net>
From: Lubomir Sedlacik <salo@Xtrmntr.org>
List: tech-userlevel
Date: 09/09/2005 15:11:19
--Y7xTucakfITjPcLV
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.
>=20
> >Yes, but the outer /etc/rc can do that before the chroot.  When the
>=20
> Yes I know - that's why I'm advocating that ;-)

i uploaded my ramdisk scripts and the patches to:

 ftp://ftp.NetBSD.org/pub/NetBSD/misc/salo/init-chroot/

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%     /

swap:

 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.
>=20
> >I can't find any code that prevents you from doing "mount -u -o
> >${options} /" as often as you like.
>=20
> 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).


regards,

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

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

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (NetBSD)

iD8DBQFDIYn2iwjDDlS8cmMRAnfdAJ4z8uJClIR88AUJUYOwQydM4QvICACeM3Zn
wH0o3XpFSz+cHmEKrefHxTM=
=gj+f
-----END PGP SIGNATURE-----

--Y7xTucakfITjPcLV--