I have a Debian wheezy (IP in the example below) server
running as NFS v4 server. Now I want to mount a directory via NFS v4
read-only and put a tmpfs on top via aufs. When I try to access a file
in /sysroot/boot (for e.g. with grep) I get the error message "Not a
directory". But it's a file!

Here's what I did on my NFS client:

mkdir /sysroot
mount -oro /sysroot
mkdir -p /live/image
mount --move /sysroot /live/image
mkdir /cow
mount -n -t tmpfs tmpfs /cow
mount -t aufs -o dirs=/cow=rw:/live/image=rr aufs /sysroot

Now I try to access a file:
grep AUFS_IN /sysroot/boot/config-3.2.0-2-amd64
grep: /sysroot/boot/config-3.2.0-2-amd64: Not a directory

Here's some strace output of a cat command which produces the same error message

execve("/bin/cat", ["cat", "/sysroot/boot/config-3.2.0-2-amd"...], [/* 17 vars 
*/]) = 0
brk(0)                                  = 0x177a000
fstat(1, {st_mode=S_IFCHR|0600, st_rdev=makedev(4, 1), ...}) = 0
open("/sysroot/boot/config-3.2.0-2-amd64", O_RDONLY) = -1 ENOTDIR (Not a 
write(2, "cat: ", 5)                    = 5
write(2, "/sysroot/boot/config-3.2.0-2-amd"..., 34) = 34
write(2, ": Not a directory", 17)       = 17

This error occurs on Debian wheezy with aufs 3.2-20120312 and kernel 

[~]# dmesg | grep aufs
[613334.618000] aufs: module is from the staging directory, the quality is 
unknown, you have been warned.
[613334.619541] aufs 3.2-20120312
[613334.620163] aufs test_add:261:mount[23264]: uid/gid/perm /live/image 
0/0/0755, 0/0/01777
[~]# uname -r

If I do the same on a NFS client running Debian squeeze with aufs
2-standalone.tree-32-20100125 and kernel 2.6.32-5-amd64 (the NFS v4 server is 
Debian wheezy) everything work fine and I can access all files in /sysroot/boot/

Any ideas how to fix this? More ideas how to debug?

regards Thomas

Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/

Reply via email to