NFS Shares – How to Export and Import with Subdirectories as Mount Points

mountnfs

Server A exports directory /srv via NFS with option nohide. A subdirectory within /srv, /srv/foo, is a mount point for another location on the NFS server using --bind option, like

server# mount --bind /bar/foo/ /srv/foo/

Client B imports A:/srv and mounts it on /mnt/srv using NFS. Contents of /mnt/srv are the contents of A:/srv.

The problem is that /mnt/srv/foo is empty, while I'm expecting to see the contents of A:/bar/foo/ there.

How to properly export and import NFS shares that have subdirectories as mount points also?

Best Answer

crossmnt is your friend.

/srv        *(rw,fsid=0,no_subtree_check,crossmnt)
Related Question