From owner-freebsd-arch Thu May 23 16:33:43 2002 Delivered-To: freebsd-arch@freebsd.org Received: from evilpete.dyndns.org (12-232-26-46.client.attbi.com [12.232.26.46]) by hub.freebsd.org (Postfix) with ESMTP id 8A72E37B406; Thu, 23 May 2002 16:33:39 -0700 (PDT) Received: from overcee.wemm.org ([10.0.0.3]) by evilpete.dyndns.org (8.11.6/8.11.6) with ESMTP id g4NNXc139906; Thu, 23 May 2002 16:33:39 -0700 (PDT) (envelope-from peter@wemm.org) Received: from wemm.org (localhost [127.0.0.1]) by overcee.wemm.org (Postfix) with ESMTP id 9A812380F; Thu, 23 May 2002 16:33:38 -0700 (PDT) (envelope-from peter@wemm.org) X-Mailer: exmh version 2.5 07/13/2001 with nmh-1.0.4 To: Maxime Henrion Cc: arch@freebsd.org Subject: Re: a virtual fs to allow root mounting of any fs without special code In-Reply-To: <20020522123610.GL496@elvis.mu.org> Date: Thu, 23 May 2002 16:33:38 -0700 From: Peter Wemm Message-Id: <20020523233338.9A812380F@overcee.wemm.org> Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Maxime Henrion wrote: > Peter Wemm wrote: > > Maxime Henrion wrote: > > > 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 > > > > You know, this sounds an awful lot like what linux does with their > > 'initrd' ramdisk and pivot_root(2). The main difference is that instead > > of the rootfs being a synthetic file system, it is a real file system > > that is read/write mounted and you can have init etc living in there. > > > > One thing you didn't clarify above, where does starting init live > > in the sequence of events above? Or is this all pre-exec-init stage? > > It would be nice to be able to fsck/remount the /root fs while we have the > > devfs nodes available. > > All this is pre-exec-init stage. So, this is to replace the pre-mountroot bdevvp etc kludges that we have? How do we solve the problem with the root fs being mounted read only and not having a /dev directory? Cheers, -Peter -- Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com "All of this is for nothing if we don't go to the stars" - JMS/B5 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message