I'm using a Synology DiskStation (DSM 4.2) as NFS server. When configuring NFS mounts on my new laptop, I got an error:
$ mount --verbose /mnt/media-diskstation mount.nfs: timeout set for Mon Apr 29 17:15:25 2019 mount.nfs: trying text-based options 'nolock,vers=4.2,addr=192.168.3.96,clientaddr=192.168.3.5' mount.nfs: mount(2): Permission denied mount.nfs: access denied by server while mounting diskstation:/volume2/media
I tried to debug this by checking which mounts are available on the NFS server:
$ showmount -e diskstation
clnt_create: RPC: Program not registered
The same command worked with a second NFS server. Let's look at the RPC information:
$ rpcinfo -p diskstation program vers proto port service 100000 4 tcp 111 portmapper 100000 3 tcp 111 portmapper 100000 2 tcp 111 portmapper 100000 4 udp 111 portmapper 100000 3 udp 111 portmapper 100000 2 udp 111 portmapper 100021 1 udp 52435 nlockmgr 100021 3 udp 52435 nlockmgr 100021 4 udp 52435 nlockmgr 100021 1 tcp 38051 nlockmgr 100021 3 tcp 38051 nlockmgr 100021 4 tcp 38051 nlockmgr 100003 2 tcp 2049 nfs 100003 3 tcp 2049 nfs 100003 4 tcp 2049 nfs 100003 2 udp 2049 nfs 100003 3 udp 2049 nfs 100003 4 udp 2049 nfs 100024 1 udp 40426 status 100024 1 tcp 36552 status
A forum post suggested that mountd is missing in that list - and really, the second (working) NFS server had mountd in its rpcinfo list.
mountd is explained by The Linux Documentation Project:
The rpc.mountd daemon in some way or other keeps track of which directories have been mounted by what hosts.
This information can be displayed using the showmount program.
So under normal circumstances mountd should be there. Let's have a look at the logs on the DiskStation in /var/log/messages:
Apr 29 16:33:10 mountd[8781]: Could not bind name to socket: Address already in use
So while reconfiguring the access rights in the DiskStation web interface, it failed to restart mountd.
Solution
I rebooted my NAS, and after two minutes of booting everything was as it should:
$ rpcinfo -p diskstation program vers proto port service 100000 4 tcp 111 portmapper 100000 3 tcp 111 portmapper 100000 2 tcp 111 portmapper 100000 4 udp 111 portmapper 100000 3 udp 111 portmapper 100000 2 udp 111 portmapper 100021 1 udp 33885 nlockmgr 100021 3 udp 33885 nlockmgr 100021 4 udp 33885 nlockmgr 100021 1 tcp 42001 nlockmgr 100021 3 tcp 42001 nlockmgr 100021 4 tcp 42001 nlockmgr 100003 2 tcp 2049 nfs 100003 3 tcp 2049 nfs 100003 4 tcp 2049 nfs 100003 2 udp 2049 nfs 100003 3 udp 2049 nfs 100003 4 udp 2049 nfs 100005 1 udp 892 mountd 100005 1 tcp 892 mountd 100005 2 udp 892 mountd 100005 2 tcp 892 mountd 100005 3 udp 892 mountd 100005 3 tcp 892 mountd 100024 1 udp 41427 status 100024 1 tcp 43319 status
Mounting and showmount also work again:
$ mount --verbose /mnt/media-diskstation mount.nfs: timeout set for Mon Apr 29 17:47:29 2019 mount.nfs: trying text-based options 'nolock,vers=4,addr=192.168.3.96,clientaddr=192.168.3.5' mount.nfs: mount(2): No such file or directory mount.nfs: trying text-based options 'nolock,addr=192.168.3.96' mount.nfs: prog 100003, trying vers=3, prot=6 mount.nfs: trying 192.168.3.96 prog 100003 vers 3 prot TCP port 2049 mount.nfs: prog 100005, trying vers=3, prot=17 mount.nfs: trying 192.168.3.96 prog 100005 vers 3 prot UDP port 892 $ showmount -e diskstation Export list for diskstation: /volume2/backup 192.168.3.3,192.168.3.4,192.168.3.1,192.168.3.2,192.168.3.5 /volume2/data 192.168.3.42,192.168.3.32,192.168.3.4,192.168.3.3,192.168.3.2,192.168.3.1,192.168.3.5 /volume2/media 192.168.3.32,192.168.3.42,192.168.3.4,192.168.3.3,192.168.3.2,192.168.3.1,192.168.3.5