Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 21 May 2002 09:34:23 -0400 (EDT)
From:      Robert Watson <rwatson@freebsd.org>
To:        Maxime Henrion <mux@freebsd.org>
Cc:        arch@freebsd.org
Subject:   Re: a virtual fs to allow root mounting of any fs without special code
Message-ID:  <Pine.NEB.3.96L.1020521093109.79313U-100000@fledge.watson.org>
In-Reply-To: <20020520212459.GH496@elvis.mu.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Spiffy.  Once the nmount conversion is done, I'd love to have this in the
base system.  As we discussed out of band, my only real concern was that
it wasn't quite a "real mount" in the sense that you don't use a 'struct
mount' when bootstrapping.  And, as we discussed, that's probably fine for
this limited scenario, from my perspective, although you don't want people
doing "mount -t rootfs foo /mnt" or anything.  I'd be interested in
hearing from others if they think the lack of a "heavy weight mount" is a
problem.

Robert N M Watson             FreeBSD Core Team, TrustedBSD Project
robert@fledge.watson.org      NAI Labs, Safeport Network Services

On Mon, 20 May 2002, Maxime Henrion wrote:

> 	Hello all,
> 
> 
> I've written a small virtual filesystem called rootfs which solves the
> chicken and egg problem of root mounting quite nicely.  Currently, we
> need special code in each filesystem to allow root mounting.  The reason
> for this is that the VFS_MOUNT operations of the filesystems generally
> need to do a lookup to get a device file (e.g. /dev/ad0s1a), so they
> need devfs to be there, and they need lookups to work.
> 
> rootfs is nothing more than a 3-vnodes filesystem (/, /dev and /root).
> To mount the root filesystem with rootfs, I do the following :
> 
> - initialize rootfs
> - mount devfs on /dev (on top of rootfs)
> - mount the real fs on /root
> - umount devfs from /dev
> - translate vnodes so that / is now the /root
> - remount devfs on /dev (on top of the real fs)
> - terminate rootfs
> 
> The attached patch implements the above idea with several restrictions.
> First, the filesystem has to be converted to the nmount(2) API for this
> to work (of course you also need devfs but it is the default).  Second,
> this patch includes the bits necessary to convert ufs to nmount, but not
> the various userland updates that are needed to get this to work (I've
> got those in my tree, but I wait for UFS2 to be committed to avoid
> unnecessary conflicts).  I just give it as a proof of concept, since it
> runs fine on my box, but don't try to compile a kernel with it :-P
> 
> I also have converted cd9660fs to nmount here and I will test it as soon
> as possible, but it's likely to work without further modifications.  NFS
> will require a bit more tricks however (it apparently has to configure
> the interface with ifioctl() before being able to talk to the server).
> 
> Comments are of course much appreciated.
> 
> Cheers,
> Maxime
> 


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.NEB.3.96L.1020521093109.79313U-100000>