17

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.

1

5 Answers 5

4

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.

2
  • Thanks for the suggestion but it doesn't work for me. Commented Feb 9, 2014 at 16:17
  • 1
    @ndejay Try cd /net/host/srv/nfs4/users. Your Arch Linux box must export the path with the insecure option, see forums.macrumors.com/showthread.php?t=317044 for more information.
    – jaume
    Commented Feb 10, 2014 at 7:59
4

I'm running into the same problem than @ndejay but the cause may differ sightly.

I'm using NFSv3 and my Autofs maps were working on OS X 10.5 to 10.8 :

/mnt -fstype=nfs,nfsvers=3,proto=tcp,resvport myserver:/share

On Mavericks it works only from the command line :

mount -t nfs -o nfsvers=3,proto=tcp,resvport myserver:/share /mnt

With a little debugging and sniffing I figured out that Mavericks's Autofs tries to mount the NFSv3 share only if its "pingnfs" check (with UDP paquets to port 111) is successful.

That behaviour added to a corporate firewall that doesn't allow UDP trafic on port 111 makes Mavericks not usable for us.

0
3

I found that the automountd service wasn't loaded on my machine (running 10.10 Yosemite).

$ sudo launchctl list | grep -i auto
84878   0   com.apple.autofsd
-   0   com.apple.preferences.timezone.auto
-   0   com.apple.automountd

Restarting autofsd and automountd and then rerunning automount -vc has made it work.

sudo launchctl unload /System/Library/LaunchDaemons/com.apple.automountd.plist
sudo launchctl unload /System/Library/LaunchDaemons/com.apple.autofsd.plist
sudo launchctl load /System/Library/LaunchDaemons/com.apple.autofsd.plist
sudo launchctl load /System/Library/LaunchDaemons/com.apple.automountd.plist
2

I've been using a commercial product called NFS Manager to handle my automounts, and it's been working great. It has a trial mode, so you can see if it works for you and is worth the money.

I have no affiliation with the product.

1

Although quite out of date, I still picked the Stack Exchange page first, 'cause the quality is always so good. In this case, however, Apple's continual re-working of OS X, combined with the passage of time, have rendered the earlier comments only marginally useful. The following should help (yes, they are hyperlinks, but they are links to pages at the internet archive).

This is a good description of the state of play as of Catalina and Big Sur. The Internet Archive link is underlying the main text, and should persist. The archived page is from Feb 2020.

https://useyourloaf.com/blog/using-the-mac-os-x-automounter/

Careful perusal of the comments at this gist.github.com link will provide some additional background to understand how things can be configured to work (also the Wayback Machine version).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .