I'm trying to setup 2 different mount points on an NFS4 server but can't get it working as desired.
/etc/exports (on server)
/mnt/raid/nas 10.1.0.0/18(rw,fsid=0,sync)
/mnt/raid/nas/file/perm 10.1.0.0/18(rw,sync,all_squash,no_subtree_check,anonuid=501,anongid=503)
/mnt/raid/nas/mail 10.1.0.0/18(rw,sync,all_squash,no_subtree_check,anonuid=5555,anongid=5555)
With the above mount points, in theory I should be able to mount the subdirs, separately, like:
$ -> mount -v -t nfs4 nas.vpc1.j1n.us:/mnt/raid/nas/file/perm /mnt/nas/store/file/perm/
But I keep getting these errors: ... failed, reason given by server: No such file or directory
, but if I mount like this:
$ -> mount -v -t nfs4 nas.vpc1.j1n.us:/ /mnt/nas/
It works. But there are other dirs in the /mnt/raid/nas folder on the NFS server which I do not want to expose to NFS clients, so this option really doesn't help.
What can I do to use NFS4, but specify mount points so I don't end up sharing everything in /mnt/raid/nas?
Figured out the problem. Because I set
/mnt/nas
as fsid=0, that means that clients mounting subdirectories no longer need to reference the entire path, only the child subdirs (relative pathing).Change this:
To this
Notice that in the 2nd set of commands the parent path
/mnt/raid/nas
is missing from theserver:/path
section of each command.