Automount NFS (from Synology NAS) on MacOS

This setup was tested on a Mac Mini (Late 2012) with macOS Mojave Version 10.14.2 and a Synology NAS with DSM 6.2.1-23824 Update 4.

Setup NFS on Synology

Go to your Synology and enable the NFS protocol.

enable NFS on Synology

Go to the shared folder you want to access via NFS and check the "Hide this shared folder" checkbox.

Check the "hide this folder"

Go to the NFS Permissions tab and set the rights as shown below. 

Set NFS rights

Read Assigning NFS Permissions for DiskStation Manager for more info.

Verify that the "nfs_volume" is exported by your Synology:

$ showmount -e synology_nas.local
Exports list on synology_nas.local:

Try to mount the volume manually:

$ sudo mount -t nfs -o resvport,rw synology_nas.local:/volume1/nfs_volume /Users/tisgoud/nfs_volume

Check if the volume is mounted:

$ df -H

Check if you can write to the volume:

$ touch /Users/tisgoud/nfs_volume/test{1..3}.txt

The map icon should also change into a shared folder icon.

Shared folder icon

In the next step we will automount the volume, so for now unmount the volume.

$ sudo umount -h synology_nas.local

Configure the automount on the NFS client

Edit the file "/etc/auto_master" as administrator and add the "auto_nfs"-line as shown below. 

# Automounter master map 
+auto_master       # Use directory service 
/net               -hosts       -nobrowse,hidefromfinder,nosuid 
/home              auto_home    -nobrowse,hidefromfinder 
/Network/Servers   -fstab 
/-                 -static 
/-                 auto_nfs     -nobrowse,nosuid

Create the file "/etc/auto_nfs", use the following content as an example for your settings.

Users/tisgoud/nfs_volume -fstype=nfs,noowners,nolockd,resvport,hard,bg,intr,rw,tcp,nfc,rsize=8192,wsize=8192 nfs://

Change `Users/tisgoud/nfs_volume` to the location where you want the volume to be visible in your local file system.

`-fstype=nfs,noowners,nolockd,resvport,hard,bg,intr,rw,tcp,nfc`, are the recommended parameters to mount the volume.

The parameter "resvport" was required to connect to the NFS volume on my Synology

Set the proper rights on the file "/etc/aut_nfs".

sudo chmod 644 /etc/auto_nfs

Mount the NFS volume.

$ sudo automount -cv
automount: /net updated
automount: /home updated
automount: /Users/tisgoud/nfs_volume updated
automount: no unmounts

That's it.

I used the following resources for the NFS-part: