Subject: Union Filesystem
To: None <tech-kern@netbsd.org>
From: Jason R. Fink <jrf@adresearch.com>
List: tech-kern
Date: 11/08/2002 19:52:13
Hello,

While recently helping out on PR kern/13419 I came across some behavoir with
the union filesystem I was hoping someone could help explain.

As I read the man page for mount_union(8), I got the impression that if I
create a file in the lower layer, it will appear in the upper, however,
a file created in the upper layer cannot be accessed in the lower layer.

According to some documentation in the 4.4BSD "Design and Implementation"
Book (pg.236) that can be over-ridden.

Anyhow, here is what I observered, my question is, is this correct?

...
deimos# mkdir /tmp/foo
deimos# mkdir /usr/bar
deimos# mount_union /tmp/foo /usr/bar
deimos# df
Filesystem       1K-blocks     Used     Avail Capacity  Mounted on
/dev/wd0a          2053695  1278178    672832    65%    /
/dev/wd0e         31764068  1745591  28430273     5%    /usr
<above>:/tmp/foo   3799286  3023769    672832    81%    /usr/bar
deimos# touch /tmp/foo/baz
deimos# touch /usr/bar/buz
deimos# ls /tmp/foo
baz buz
deimos# ls /usr/bar
baz buz
...

Thanks,

	j

-- 
Jay Fink <http://pyxis.homeunix.net/>
NetBSD Developer <http://www.netbsd.org/>
Senior SysAdmin/Programmer, Ipsos <http://www.ipsos.com/>