Memory disk "a la mfsroot"?

Matthew Seaman m.seaman at
Thu Feb 11 15:54:45 UTC 2010

Hash: SHA1

On 11/02/2010 15:39, RW wrote:
> On Thu, 11 Feb 2010 15:12:22 +0000
> Matthew Seaman <m.seaman at> wrote:

>> On 11/02/2010 14:53, Pierre-Luc Drouin wrote:
>>> I would like to know if there is a mount command that allows to
>>> create a memory disk that can be initialized from a file. What I am
>>> looking for is something like mount_mfs -F, but that does not
>>> modify the actual file. I know what I could easily to this by
>>> copying the content of the file to the memory disk, but I am
>>> looking for a solution that can be configured via fstab.
>> Yes.  See mdconfig(8) -- there are examples in there of exactly what
>> you want to do.
> I don't think covers what he is asking for. I think you would need a
> union filsystem that overlays a swap-backed filesystem on top of a
> file-backed filesystem - if that's possible.

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.



- -- 
Dr Matthew J Seaman MA, D.Phil.                   7 Priory Courtyard
                                                  Flat 3
PGP:     Ramsgate
                                                  Kent, CT11 9PW
Version: GnuPG/MacGPG2 v2.0.14 (Darwin)
Comment: Using GnuPG with Mozilla -


More information about the freebsd-questions mailing list