I use an aging Western Digital NAS drive and have found it harder and harder to make macOS continue to connect to its shares using AFP. Even the fixes I link above are a pain to get working reliably, due to the file system’s weird behaviour these days with plist files. On a borrowed Sierra MacBook Pro it finally gave up the ghost and refused to talk any longer. Mount attempts were returning alternately errno 32 and 89, suspicions led toward .AppleDB folders on the shares before I decided enough was enough.

“Never mind” I said to myself, “Apple wants us to use Samba these days anyway, I’ll configure that instead”. AFP performance was never exactly stellar, but oh my god Samba is abysmal!!1 I’ll admit I wasn’t helping myself in that the files in question were multi-hundred gigabyte sparse disk images on the NAS, but still and all there had to be another way..

Fortunately there is; the venerable protocol from Sun named NFS.

For whatever reason, Apple don’t make it easy or obvious how to connect NFS shares, so here’s the steps to follow:

    1. On your server, set up one or more NFS shares. How to do this will depend on your server; in my case the NAS GUI Folder Shares simply has a tick-box to enable NFS for a given share.
    2. Open Terminal and in your favourite text editor, add the following line to the end of /etc/auto_master:

      /mnt/nfs auto_nfs

    3. Create a new file named /etc/auto_nfs, with the following content, all on one line. Note that the items in italics are placeholders for your specifics, and that all NFS shares on WD NAS drives start with /nfs/. I spent a long time playing with the fstype parameter list to find something that worked; there are many resources online if you would like to understand each parameter in more detail:

      sharename -fstype=nfs,vers=3,rw,soft,intr,rsize=32768,wsize=32768,noatime,timeo=1200,retrans=10,proto=tcp,resvport,locallocks,noacl nfs://ip address of server/sharename

    4. Create a mount point for each share listed in auto_nfs. Do not create these in /Volumes – macOS will delete them when you restart your machine:

      sudo mkdir /mnt/nfs

    5. Finally, to inform the NFS client of the new configuration, execute the following:

      sudo automount -cv

    The extra bonus of this approach is that it uses the automount system, meaning the OS will mount any of these shares as soon as you attempt to browse to them. To make it easier to access these mount points more easily from Finder, use Go To (⌘⇪G) and type in /mnt, then drag the folder ‘nfs’ shown in Finder to your Favourites bar over on the left.

  1. H/T to the publishers of the following articles that helped me coalesce this solution:
  2. https://smekkley.wordpress.com/2014/01/18/time-machine-via-nfs-on-mavericks/
  3. http://blog.centurio.net/2016/03/16/automount-network-shares-on-mac-os-for-use-in-itunes/
  4. https://lb9mg.no/2016/03/23/using-os-x-time-machine-with-nfs/

 

Update:

  1. It turns out that a security change in 10.11.5 might be the cause of SMB slowness, and here’s how to disable that feature to get better throughput. ↩︎