Export NFS across file systems

Issues related to configuring your network
Post Reply
ubernoob
Posts: 1
Joined: 2008/02/18 07:08:25

Export NFS across file systems

Post by ubernoob » 2008/02/18 07:19:29

Is it possible to export NFS across file systems? I don't get it to work. If i mount /data/shared that filesystem works from the client. But not the filesystem in /data/shared/files. See the code below for more details:

On the server:
[code]
# cat /etc/exports
/data/shared 10.0.0.0/255.255.255.0(rw,all_squash) 192.168.1.0/255.255.255.0(rw,all_squash)


# cat /etc/fstab
LABEL=/ / ext3 defaults 1 1
LABEL=/data /data ext3 defaults 1 2
/dev/hda2 /data/shared/files ext3 defaults 1 2
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
LABEL=SWAP-hda3 swap swap defaults 0 0

]# ls -l /data/shared/
total 24
drwxrwxr-x 5 myuser nfsnobody 4096 Feb 18 06:57 a
drwxrwxr-x 5 myuser nfsnobody 4096 Feb 13 20:01 b
drwxrwxr-x 9 myuser nfsnobody 4096 Feb 18 07:01 files
[/code]
On the guest:[code]
$ sudo mount -v kengu:/data/shared/ /data/
mount: no type was given - I'll assume nfs because of the colon
mount.nfs: trying 10.0.0.9 prog 100003 vers 3 prot tcp port 2049
mount.nfs: trying 10.0.0.9 prog 100005 vers 3 prot udp port 706
kengu:/data/shared/ on /data type nfs (rw)

$ touch /data/a/testfile
$ touch /data/b/testfile
$ touch /data/files/testfile
touch: cannot touch `/data/files/testfile': Permission denied

$ ls -l /data/
total 24
drwxrwxr-x 5 myuser nogroup 4096 2008-02-18 07:34 a
drwxrwxr-x 5 myuser nogroup 4096 2008-02-18 07:34 b
drwxr-xr-x 2 myuser nogroup 4096 2008-02-13 19:25 files <-- somehow the group permission have changed here.


$ sudo mount -v kengu:/data/shared/files /data/
mount: no type was given - I'll assume nfs because of the colon
mount.nfs: trying 10.0.0.9 prog 100003 vers 3 prot tcp port 2049
mount.nfs: trying 10.0.0.9 prog 100005 vers 3 prot udp port 706
mount.nfs: kengu:/data/shared/files failed, reason given by server: Permission denied
gran@whisky:/$ sudo mount -v kengu:/data/shared/a /data/
mount: no type was given - I'll assume nfs because of the colon
mount.nfs: trying 10.0.0.9 prog 100003 vers 3 prot tcp port 2049
mount.nfs: trying 10.0.0.9 prog 100005 vers 3 prot udp port 706
kengu:/data/shared/a on /data type nfs (rw)[/code]

Steve_K
Posts: 6
Joined: 2007/10/03 09:40:42

Export NFS across file systems

Post by Steve_K » 2008/02/19 10:01:52

Hi,

I believe the behavoir you are seeing is due to the fact that the /data/shared/files directory has another filesystem mounted on it that you are trying to export by exporting the parent filesystem (/data).

Look at the [b]nohide[/b] option in the [b]exports(5)[/b] man page (you know about the [b]man[/b] command, right?) - this should give you what you want, but can cause problems. If I wasn't sure about the client, I'd export and mount them as two seperate filesystems.

Cheers,
Steve

Post Reply

Return to “CentOS 5 - Networking Support”