5

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.

  • 1
    And the log files say? sudo zegrep -w nfs /var/log/* would be step 0. – waltinator Jul 20 '15 at 18:41
  • Do you not see the 5 areas for YOU to investigate on your system? Check that /var/lib/nfs/and /var/lib/nfs/v4recovery exist with correct ownership/permission, check systemd job nfs-blkmap.service (probably in /etc/init/) for depending something that is not available, try to understand why, at mount.nfs time, you get the Temporary failure in name resolution (where does number0 get resolved?) Does your NFS resolver try some other method first? – waltinator Jul 20 '15 at 21:53
  • The 1st two directories exist (see edit). /etc/init does not contain nfs-blkmap.service. I don't know where number0 gets resolved or what my NFS resolver is. However, I've just booted the machine up and the NFS shares have mounted automatically, despite me not changing anything. – Carl H Jul 21 '15 at 17:16
  • I would suggest to use _netdev in /etc/fstab entry option; unix.stackexchange.com/q/169697/116970. It seems the NFS share are mounted too earlier in the boot process. – solsTiCe Jul 25 '15 at 16:26
  • @solsTiCe The _netdev option does not make any difference. – Carl H Jul 25 '15 at 17:42
2

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:

number0:/projects /home/carl/number0/projects nfs rw 0 0

to

192.168.1.65:/projects /home/carl/number0/projects nfs rw 0 0
1

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.

systemctl enable NetworkManager-wait-online.service

Good explanation here.

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.