Union mounts

John Bradford (john@bradfords.org.uk)
Sun, 15 Dec 2002 14:03:29 +0000 (GMT)


> I disagree. It should create it in directory d, even though that is
> the mount point.
>
> A union mount should include files from another directory, but writes
> should go to the actual named directory.
>
> Union mounts should be read only.
>
> If read-write union mounts are needed, I don't think that we should
> implement them significantly differently to the way they work in BSD.

That wasn't very well explained, what I mean is this:

Example:

# cd /
# mkdir foo
# mount -o union /dev/hda2 /foo
# echo foobar > foo/bar
# umount /dev/hda2
# cat foo/bar
foobar

That's what I would consider to be the most useful way to implement
union mounts - the contents of /dev/hda2 would be accessible,
read-only, at /foo/bar, with files that already exist in /foo/bar
replacing files that would otherwise be visible from /dev/hda2.

Writes would go to the directory foo, which is just an ordinary
subdirectory of the root filesystem.

This is completely different to the mount_union behavior in BSD, where
writes go to the most recently added union mount.

However, it might be best to implement things the BSD way for
compatibility reasons, but I'm not sure how widespread the use of
mount_union is. It's probably not widely used.

John.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/