From owner-freebsd-questions@FreeBSD.ORG Thu Feb 11 19:19:23 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 265CA106568F for ; Thu, 11 Feb 2010 19:19:23 +0000 (UTC) (envelope-from m.seaman@infracaninophile.co.uk) Received: from smtp.infracaninophile.co.uk (gate6.infracaninophile.co.uk [IPv6:2001:8b0:151:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id 8BD318FC12 for ; Thu, 11 Feb 2010 19:19:22 +0000 (UTC) Received: from seedling.black-earth.co.uk (seedling.black-earth.co.uk [81.187.76.163]) (authenticated bits=0) by smtp.infracaninophile.co.uk (8.14.4/8.14.4) with ESMTP id o1BJJGEp006626 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Thu, 11 Feb 2010 19:19:17 GMT (envelope-from m.seaman@infracaninophile.co.uk) X-DKIM: Sendmail DKIM Filter v2.8.3 smtp.infracaninophile.co.uk o1BJJGEp006626 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=infracaninophile.co.uk; s=201001-infracaninophile; t=1265915957; bh=Ikg797V142mphs/mcoUJbZlWaLN7jdpZRkwCHSnmEZY=; h=Message-ID:Date:From:MIME-Version:To:CC:Subject:References: In-Reply-To:Content-Type:Content-Transfer-Encoding:Cc:Content-Type: Date:From:In-Reply-To:Message-ID:Mime-Version:References:To; z=Message-ID:=20<4B745834.1010309@infracaninophile.co.uk>|Date:=20T hu,=2011=20Feb=202010=2019:19:16=20+0000|From:=20Matthew=20Seaman= 20|Organization:=20Infracaninophi le|User-Agent:=20Mozilla/5.0=20(Macintosh=3B=20U=3B=20Intel=20Mac= 20OS=20X=2010.6=3B=20en-GB=3B=20rv:1.9.1.7)=20Gecko/20100111=20Thu nderbird/3.0.1|MIME-Version:=201.0|To:=20Pierre-Luc=20Drouin=20|CC:=20RW=20,=20fr eebsd-questions@freebsd.org|Subject:=20Re:=20Memory=20disk=20"a=20 la=20mfsroot"?|References:=20<4B7419F5.7050602@pldrouin.net>=09<4B 741E56.8010002@infracaninophile.co.uk>=09<20100211153925.7b88844d@ gumby.homeunix.com>=20<4B74283B.1070903@infracaninophile.co.uk>=20 <4B743A16.9020201@pldrouin.net>|In-Reply-To:=20<4B743A16.9020201@p ldrouin.net>|X-Enigmail-Version:=201.0|Content-Type:=20text/plain= 3B=20charset=3DUTF-8|Content-Transfer-Encoding:=207bit; b=CHJtn2tb7R0roPIDXOfUFpQpdX8ZU+WF9EmkmfAju8Y177b2KRCL2Qv+VuUApvuFq hQTzes9BdyddRHuvw9wUJRT9y3eII53MxQv2XiNj1p9XF2unDt8nuK9v0ugRB3wVX3 EJd+ws3LZ5amuFpXX6dYKp3GEAmYGz0J8Y3d3vsY= Message-ID: <4B745834.1010309@infracaninophile.co.uk> Date: Thu, 11 Feb 2010 19:19:16 +0000 From: Matthew Seaman Organization: Infracaninophile User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-GB; rv:1.9.1.7) Gecko/20100111 Thunderbird/3.0.1 MIME-Version: 1.0 To: Pierre-Luc Drouin References: <4B7419F5.7050602@pldrouin.net> <4B741E56.8010002@infracaninophile.co.uk> <20100211153925.7b88844d@gumby.homeunix.com> <4B74283B.1070903@infracaninophile.co.uk> <4B743A16.9020201@pldrouin.net> In-Reply-To: <4B743A16.9020201@pldrouin.net> X-Enigmail-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Scanned: clamav-milter 0.95.3 at happy-idiot-talk.infracaninophile.co.uk X-Virus-Status: Clean X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_FAIL autolearn=no version=3.3.0 X-Spam-Checker-Version: SpamAssassin 3.3.0 (2010-01-18) on happy-idiot-talk.infracaninophile.co.uk Cc: RW , freebsd-questions@freebsd.org Subject: Re: Memory disk "a la mfsroot"? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2010 19:19:23 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 11/02/2010 17:10, Pierre-Luc Drouin wrote: >> Actually, I was thinking more along the lines of mounting a .iso as a >> cd9660 filesystem. Which won't muck up the underlying .iso, but only >> because it's read-only. You could mount a FFS image read-only in >> exactly the same way -- I think there's a 'last mounted on' field in the >> backing file image that will be updated if the it is writable (even if >> the fs itself is mounted ro) but that's not the right answer either. >> >> Basically, you're going to have to mount and initialise as two separate >> operations as far as I can see. >> > By this do you mean that I would need to copy the whole content of the > read-only filesystem to the memory disk? Yes. > I looked at the man page for mount_unionfs and there is a big warning > saying that it is a bad idea to use it, so I guess I will pass on this > solution... Ah -- that warning is probably a bit more alarming than it really needs to be nowadays. unionfs can be used pretty effectively for many purposes. Try it and see what happens is the best policy. > What I am trying to do basically is to mount a filesystem from a CD but > I want to use a memory disk to allow write operations. I would basically > want the filesystem to behave like a regular read-write filesystem, but > not have to copy everything into a memory disk. What does "mfs_root" do > exactly in the official FreeBSD boot CDs? Does it copy the content of > mfsroot.gz into a memory disk? That filesystem is so small that I guess > it can be copied without any problem... mfs_root does exactly that: it creates a memory based filesystem and then expands a tarball of the system into it. One approach you might consider is mounting your CD image read-only as per usual, but creating memory-based /tmp and /var partitions[*]. Most of the usual root and /usr filesystems don't need to be read-write at all. There are only a few special locations that do and those will need special handling. You will need to initialise your memory-backed /var partiton by expanding a skeleton structure into it, but that's going to be pretty small really. You will also need to make provision for editing various files under /etc -- you might be able to create a /var/etc and replace the real files in /etc with symlinks to copies in /var/etc. Possibly. Or you could just have /var/etc nullfs mounted on top of /etc. I've read reports from people setting up such things -- a while back now, but as far as I recall they were on the whole successful. Cheers, Matthew [*] There are already scripts to do this sort of thing within the base system, although primarily aimed at diskless systems. - -- Dr Matthew J Seaman MA, D.Phil. 7 Priory Courtyard Flat 3 PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate Kent, CT11 9PW -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.14 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkt0WDQACgkQ8Mjk52CukIyWgwCeMHjE7VsdHx5HLGQw75SplJ9v 6zUAni7BZsLYsp2qGSFUUMmkjpVMYomt =4SwV -----END PGP SIGNATURE-----