Hello all,

I am using unionfs 1.1.3 with 2.6.9 (RHEL4 2.6.9-22.0.2 base) to try to
get a writable overlay to a read-only shared NFS root filesystem.  The
problem I seem to be having is even though I have a RW branch specifed
to the left of the RO branch, I'm still getting EROFS trying to create a
file for example.

First the details:

# cat /proc/mounts
10.8.0.8:/mnt/boots/boulder/generic-node /sysroot-ro nfs 
ro,v3,rsize=32768,wsize=32768,hard,udp,nolock,addr=10.8.0.8 0 0
none /sysroot-rw tmpfs rw 0 0
none /sysroot unionfs 
rw,dirs=/sysroot-rw=rw:/sysroot-ro=ro,debug=0,delete=whiteout,copyup=preserve 0 0

Which I mounted with:

# mount -t unionfs -o 
dirs=/sysroot-rw=rw:/sysroot-ro=ro,debug=0,delete=whiteout none /sysroot

I do believe the semantics of my NFS are correct to allow me to use
"=ro" rather than "=nfsro" (nfsro doesn't change anything anyway):

# /sysroot/usr/bin/strace -e trace=file /sysroot/bin/touch /sysroot-ro/foo 
execve("/sysroot/bin/touch", ["/sysroot/bin/touch", "/sysroot-ro/foo"], [/* 7 
vars */]) = 0
...
open("/sysroot-ro/foo", O_WRONLY|O_NONBLOCK|O_CREAT|O_NOCTTY, 0666) = -1 EROFS 
(Read-only file system)

and

# ls -l /sysroot-ro/create_timestamp
-rw-r--r--    1 0        0               0 Feb 24 21:43 
/sysroot-ro/create_timestamp
# /sysroot/usr/bin/strace -e trace=file /sysroot/bin/touch 
/sysroot-ro/create_timestamp
open("/sysroot-ro/create_timestamp", O_WRONLY|O_NONBLOCK|O_CREAT|O_NOCTTY, 
0666) = -1 EROFS (Read-only file system)

So attempts to both create a non-existent file and write to an existent
file on the RO NFS root both return EROFS.

Now when I try to do:

# /sysroot/bin/touch /sysroot/foo
/sysroot/bin/touch: cannot touch `/sysroot/foo': Read-only file system

But should that not succeed and be written into the /sysroot-rw branch?
I can write to that branch directly and see the results in the union:

# ls -l /sysroot/foo
ls: /sysroot/foo: No such file or directory
# ls -l /sysroot-rw/foo
ls: /sysroot-rw/foo: No such file or directory
# /sysroot/bin/touch /sysroot-rw/foo
# ls -l /sysroot/foo
-rw-r--r--    1 0        0               0 Mar  3 00:36 /sysroot/foo

Any ideas what's going on?

Thanx,
b.

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
unionfs mailing list
[email protected]
http://www.fsl.cs.sunysb.edu/mailman/listinfo/unionfs

Reply via email to