Date: Thu, 11 Feb 2010 19:19:16 +0000 From: Matthew Seaman <m.seaman@infracaninophile.co.uk> To: Pierre-Luc Drouin <pldrouin@pldrouin.net> Cc: RW <rwmaillists@googlemail.com>, freebsd-questions@freebsd.org Subject: Re: Memory disk "a la mfsroot"? Message-ID: <4B745834.1010309@infracaninophile.co.uk> In-Reply-To: <4B743A16.9020201@pldrouin.net> References: <4B7419F5.7050602@pldrouin.net> <4B741E56.8010002@infracaninophile.co.uk> <20100211153925.7b88844d@gumby.homeunix.com> <4B74283B.1070903@infracaninophile.co.uk> <4B743A16.9020201@pldrouin.net>
next in thread | previous in thread | raw e-mail | index | archive | help
-----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-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4B745834.1010309>