Date: 04 Dec 2002 15:52:38 +1000 From: Duncan Anker <d.anker@au.darkbluesea.com> To: "Marc G. Fournier" <scrappy@hub.org> Cc: freebsd-questions@freebsd.org Subject: Re: using mount_union Message-ID: <1038981158.4054.55.camel@duncan.au.darkbluesea.com> In-Reply-To: <20021204004113.P36076-100000@hub.org> References: <20021204004113.P36076-100000@hub.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 2002-12-04 at 14:48, Marc G. Fournier wrote: > Evening all ... > > I just read through the man page a couple of times, and it sounded quite > straightforward, but I've obviously mis-understood ... > > My read of the man page is that I can create to directories (/d1 and > /d2), mount /d1 over /d2 (mount_union /d2 /d1) and if I create a file in > /d2, it won't show up in /d1, but if I create on in /d1, it will show up > in /d2 ... > Did you read this bit in the man pages? :-) THIS FILESYSTEM TYPE IS NOT YET FULLY SUPPORTED (READ: IT DOESN'T WORK) AND USING IT MAY, IN FACT, DESTROY DATA ON YOUR SYSTEM. USE AT YOUR OWN RISK. BEWARE OF DOG. SLIPPERY WHEN WET. Apart from that, my reading would be that if you mount_union /d2 /d1, then any files in /d2 would mask /d1. Hence if a file exists in both locations, you will never see the one in /d1. On the other hand, if you create the file in either location it will show up in the union. > But, when I tried it "in reality", it didn't matter which one I created > in, it showed up in the other one ... Sounds right to me. > > venus# mkdir d1 d2 > venus# mount_union /v1/test/d2 /v1/test/d1 > venus# touch /v1/test/d1/testfile > venus# touch /v1/test/d2/testfile2 > venus# ls -lR > total 4 > drwxr-xr-x 4 root wheel 512 Dec 3 22:45 d1 > drwxr-xr-x 2 root wheel 512 Dec 3 22:45 d2 > > ./d1: > total 0 > -rw-r--r-- 1 root wheel 0 Dec 3 22:45 testfile > -rw-r--r-- 1 root wheel 0 Dec 3 22:45 testfile2 > > ./d2: > total 0 > -rw-r--r-- 1 root wheel 0 Dec 3 22:45 testfile > -rw-r--r-- 1 root wheel 0 Dec 3 22:45 testfile2 > > > And when I umount the file system, d1 loses the files that were created on > it: Because they were really created in d2 - files are created in the upper layer, and searched for upper-to-lower. > > venus# umount /v1/test/d1 > venus# df -t union > venus# ls -lR > total 4 > drwxr-xr-x 2 root wheel 512 Dec 3 22:44 d1 > drwxr-xr-x 2 root wheel 512 Dec 3 22:45 d2 > > ./d1: > > ./d2: > total 2 > -rw-r--r-- 1 root wheel 28 Dec 3 22:46 testfile > -rw-r--r-- 1 root wheel 0 Dec 3 22:45 testfile2 > > So have I totally botched my read of the man page, or am I just doign > something wrong? :( Botching a read of the man page is not doing something wrong? :-) Did you try creating 2 different files with the same name in d1 and d2 *before* union mounting? Cheers, Duncan -- The information contained in this email is confidential. If you are not the intended recipient, you may not disclose or use the information in this email in any way. Dark Blue Sea does not guarantee the integrity of any emails or attached files. The views or opinions expressed are the author's own and may not reflect the views or opinions of Dark Blue Sea. Dark Blue Sea does not warrant that any attachments are free from viruses or other defects. You assume all liability for any loss, damage or other consequences which may arise from opening or using the attachments. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1038981158.4054.55.camel>