Tell me more ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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?

share|improve this question
Maybe easier to just use symlink on A from /srv/foo --> /bar/foo ? – ckhan Jul 6 '12 at 6:55
I tried this. This would try to get to the /bar/foo on client machine B, not on server A. – mbaitoff Jul 6 '12 at 10:59

1 Answer

up vote 1 down vote accepted

Looks like every mount sub-point must be exported by the NFS server in order to be visible for clients. In the situation above the /etc/exports file should look like the following:

/srv        *(rw,fsid=0,nohide,no_subtree_check)
/srv/foo    *(rw,nohide,no_subtree_check)

Then, importing /srv on the client with option -t nfs will make both /srv and /srv/foo properly available.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.