I have an NAS device and mount several directories on it via entries in /etc/fstab
:-
# NFS
number0:/projects /home/carl/number0/projects nfs rw 0 0
number0:/carl /home/carl/number0/stuff nfs rw 0 0
number0:/Qmultimedia /home/carl/Music nfs rw 0 0
number0:/Photos /home/carl/Pictures nfs rw 0 0
Recently (possibly since an update although I'm not sure), the NFS shares are not mounting on bootup, and I have to mount them with sudo mount -a
.
As I've used the same fstab entries since Ubuntu 10.04 (maybe earlier), I suspect that there has been some change to the fstab standard that I no longer comply with.
There are numerous questions on AU about NFS not automounting but all relate to much older versions of Ubuntu, apart from this one, which does not seem relevant.
Edit: the output of sudo zegrep -w nfs /var/log/*
is
/var/log/syslog.7.gz:Jul 8 19:35:16 number2 ureadahead[214]: ureadahead:/var/lib/nfs/.etab.lock: No such file or directory
/var/log/syslog.7.gz:Jul 8 19:35:16 number2 ureadahead[214]: ureadahead:/var/lib/nfs/.xtab.lock: No such file or directory
/var/log/syslog.7.gz:Jul 8 19:35:16 number2 kernel: [ 4.974103] systemd[1]: Job nfs-blkmap.service/start failed with result 'dependency'.
/var/log/syslog.7.gz:Jul 8 19:35:20 number2 kernel: [ 19.287387] NFSD: Using /var/lib/nfs/v4recovery as the NFSv4 state recovery directory
/var/log/syslog.7.gz:Jul 8 19:35:26 number2 mount[767]: mount.nfs: Failed to resolve server number0: Temporary failure in name resolution
/var/log/syslog.7.gz:Jul 8 19:35:26 number2 mount[770]: mount.nfs: Failed to resolve server number0: Temporary failure in name resolution
/var/log/syslog.7.gz:Jul 8 19:35:26 number2 mount[773]: mount.nfs: Failed to resolve server number0: Temporary failure in name resolution
/var/log/syslog.7.gz:Jul 8 19:35:26 number2 mount[774]: mount.nfs: Failed to resolve server number0: Temporary failure in name resolution
/var/log/syslog.7.gz:Jul 8 19:35:26 number2 mount[775]: mount.nfs: Failed to resolve server number0: Temporary failure in name resolution
/var/log/syslog.7.gz:Jul 8 19:42:50 number2 kernel: [ 470.817815] FS-Cache: Netfs 'nfs' registered for caching
The NFS server is number0, which has been up and running the whole time (I have another machine also connected to the same NFS shares).
carl@number2:~$ ping number0
PING number0.home (192.168.1.65) 56(84) bytes of data.
64 bytes from number0.home (192.168.1.65): icmp_seq=1 ttl=64 time=0.364 ms
Edit 2: @waltinator asked me to check the existance and permissions of these directories
carl@number2:~$ ls -l /var/lib | grep nfs
drwxr-xr-x 5 statd nogroup 4096 Jul 21 17:55 nfs
carl@number2:~$ ls -l /var/lib/nfs | grep v4recovery
drwxr-xr-x 2 root root 4096 Apr 27 23:05 v4recovery
Edit: the shares actually appear in Nautilus but are unmounted.
Have you tried changing from server name (number0) to IP (192.168.1.65)?
It seems that at the mount time there is a problem in the name resolution.
For example change from:
to
Blame systemd. It was likely in your recent update. It needs to be explicitly told to wait for network stuff to be ready before attempting to mount.
Good explanation here.