From owner-freebsd-fs@FreeBSD.ORG Wed Mar 23 06:30:02 2011 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 498FB1065676 for ; Wed, 23 Mar 2011 06:30:02 +0000 (UTC) (envelope-from lastewart@swin.edu.au) Received: from lauren.room52.net (lauren.room52.net [210.50.193.198]) by mx1.freebsd.org (Postfix) with ESMTP id 01AB48FC1B for ; Wed, 23 Mar 2011 06:30:01 +0000 (UTC) Received: from lawrence1.loshell.room52.net (ppp59-167-184-191.static.internode.on.net [59.167.184.191]) by lauren.room52.net (Postfix) with ESMTPSA id B7E4E7E8D5; Wed, 23 Mar 2011 17:30:00 +1100 (EST) Message-ID: <4D899368.9090709@swin.edu.au> Date: Wed, 23 Mar 2011 17:30:00 +1100 From: Lawrence Stewart User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-AU; rv:1.9.2.15) Gecko/20110308 Lightning/1.0b2 Thunderbird/3.1.9 MIME-Version: 1.0 To: Jeremy Chadwick References: <4D8989A5.1020203@swin.edu.au> <20110323061641.GA74977@icarus.home.lan> In-Reply-To: <20110323061641.GA74977@icarus.home.lan> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on lauren.room52.net Cc: freebsd-fs@freebsd.org Subject: Re: mount -o union doesn't allow changes to sub directories? X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Mar 2011 06:30:02 -0000 Hi Jeremy, On 03/23/11 17:16, Jeremy Chadwick wrote: > On Wed, Mar 23, 2011 at 04:48:21PM +1100, Lawrence Stewart wrote: >> Hi again, >> >> If I run something like: >> >> mount -o union /dev/md0 /etc >> >> where md0 is a memory backed fs device, and /etc is fully populated but >> mounted RO off a CD, I can touch a new file in /etc, but can't in any >> subdir of etc (fails with "Read-only filesystem" reported). >> >> As far as I can tell this is a bug, but wanted to check if I'm >> misunderstanding how the "-o union" mount option is supposed to work. > > Please see mount_unionfs(8), specifically the explanations of "lower" > and "upper" layers, along with EROFS (errno 30, "Read-only filesystem"). I don't think 'mount -o union' is the same thing as doing a unionfs mount. Earlier today I was playing with unionfs and it worked perfectly for the scenario I describe above. 'mount -o union' seems to do something similar, but subtly different to unionfs. The key difference from the UI perspective is that unionfs can be used to mount a directory on top of another directory, whereas using 'mount -o union' requires you to mount a device with an fs on it on top of a directory. The semantics of 'mount -o union' are far more useful for my situation that unionfs, so I'm keen to try and see if I can get it working properly, which I suspect will involve a kernel patch. Cheers, Lawrence