NFS and crossmnt

2009-04-05 by Bluewind

Yesterday I restarted my NFS server and today I noticed I couldn't access some shares. I've set it up like that:

/srv/nfs 192.168.4.1/24(crossmnt,rw,sync,no_subtree_check)
/srv/nfs/foo 192.168.4.1/24(crossmnt,nohide,rw,sync,no_subtree_check)

/srv/nfs mounted to /mnt/nfs

When I now wanted to go to /mnt/nfs/foo I got a permission error which is strange because I DID export /srv/nfs/foo and use crossmnt for /srv/nfs and even nohide (manpage says you only need crossmnt for /srv/nfs and then just export /srv/nfs/foo).

After some fiddling (well, actually when I gave up) I found out that you have to mount /srv/nfs/foo somewhere else (I mounted it to /mnt/foo) before you can go to /mnt/nfs/foo. Once you did that you can unmount it again, but you can now access /mnt/nfs/foo.

The expected behaviour would be mounting /srv/nfs to /mnt/nfs and beeing able to cd to /mnt/nfs/foo.