Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 5 Jun 2006 22:34:32 +0200
From:      Bastiaan Welmers <bastiaanpu@welmers.net>
To:        freebsd-fs@freebsd.org
Subject:   execution from unionfs issue
Message-ID:  <20060605203432.GA21420@routeduvel.rembrandtkd.welmers.net>

next in thread | raw e-mail | index | archive | help
Hi,

I was wondering the following behavior from a unionfs mounted tree was
normal or a bug:

When mounting a tree on a directory as lower layer and I execute a
binary from the lower layer, it will create a non-executable copy of the
binary file on the upper layer:

# mkdir /tmp/bin

# mount -t unionfs -o -b /bin /tmp/bin

# cd /tmp/bin

# ./ls -l
....
-r-xr-xr-x  1 root  wheel   24232 30 mei 04:06 ls

# ./ls -l
./ls: Permission denied

# /bin/ls -l
....
-rw-r--r--  1 root  wheel  24232  5 jun 22:23 ls

# cd /

# umount /tmp/bin

# ls -l /tmp/bin
-rw-r--r--  1 root  wheel  24232  5 jun 22:23 ls

using -b or not (inversing upper/lower layer or not) does not matter,
without -b same problem (when mounting /tmp/bin on /bin this time).

It look likes when executing files it will try to open it read-write or
something (for updating access time?) and unionfs creates a new
(non-executable) copy on the upper layer. 
I don't know this is desirable behavior or not in general, to me it
isn't at least. (I use it to provide basic userland for jails) I found
the "noatime" mount option helps to resolve the problem, but I can't find
this in any documentation.

I'm using FreeBSD 6.1-RELEASE i386 GENERIC.

/Bastiaan



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060605203432.GA21420>