MacOS – How to automatically mount NFS shares on OS X

automountmacosnfsunix

I have a NFS server set up on my local LAN running on Arch Linux that I can connect to using OS X Mavericks by issuing the following command in the terminal:

mount -t nfs -o resvport host:/srv/nfs4/users /mnt/host

As the NFS client is a MacBook Pro, I would like for it to automatically connect to the NFS server whenever I am home (and do nothing otherwise). Adding the following line in /etc/auto_master did not work:

/mnt/host -fstype=nfs4,resvport host:/srv/nfs4/users

More specifically, running automount -vc yields the following:

automount: /net updated
automount: /home updated
automount: /mnt/host nmounted
automount: no unmounts

…but /mnt/host is an empty directory even when I cd into it.

Can anybody help me out? Thanks in advance and let me know if I omitted important details.

Best Answer

If you try default /etc/auto_master file, you can see line

/net            -hosts      -nobrowse,hidefromfinder,nosuid

Then you can cd /net/host/exported/path and found that mac tries to mount this exported path.