How to mount multiple folders with nfs4 on centos?
In order to share the subdirectories, I had to share the parent folder first with fsid=0. So on the server /etc/exports looks like this:
/var/shared 192.168.200.101(rw,fsid=0,sync)
/var/shared/folder1 192.168.200.101(rw,sync)
/var/shared/folder2 192.168.200.101(rw,sync)
then on the client /etc/fstab looks like:
192.168.200.201:/folder1 /home/nfsmnt/folder1 nfs4 rw 0 0
192.168.200.201:/folder2 /home/nfsmnt/folder2 nfs4 rw 0 0
I can then mount the folders as expected:
mount /home/nfsmnt/folder1
The problem is that you have fsid=0
for two exported filesystems. That is the error message you're getting. fsid=0
is used to set the top of the exported filesystem tree in nfsv4. Set that only once. Typically you'd have something like this i /etc/exports on the server:
/var/shared 192.168.200.101(rw,fsid=0,sync)
/var/shared/folder1 192.168.200.101(rw,sync)
/var/shared/folder2 192.168.200.101(rw,sync)
See http://www.centos.org/docs/5/html/Deployment_Guide-en-US/s1-nfs-server-config-exports.html