Ubuntu – How to mount a NFS share in Ubuntu 16.04

16.04mountnfssystemd

I made a fresh install of Xubuntu 16.04 recently. Before I used 14.04 and mounted a a NFS share with the following line in the /etc/fstab

192.168.178.66:/media/user/drive /media/user/banana nfs rw 0 0

What should happen?

The nfs share should be mounted on startup into the given location.

What happens?

Boot takes very long and the nfs share is not mounted. A greyed symbol for the share appears on my desktop. When I click on it it says something like "Only root can mount". When I press an arrow during boot I can see the systemd log (I suppose) it says ~ "Startjob for /media/user/banane (30s/1,31s)" It wait’s the whole 91s and the it finally boots. Mounting the nfs manually works. But then shutdown does not end. Looking at the systemd output again: "Stop job for /media/netzwerkfreigabe (30s/2m)" The shutdown does not end at the given limit. Instead another longer limit appears. At least three times.

Additional Information

  • the package nfs-common is installed on the client computer
  • the nfs server is a BananaPi running BananianLinux (a modified Debian Jessy)
  • I can mount the nfs-share using the same /etc/fstab line from another computer using Xubuntu 14.04

As far as I know systemd is introduced in Ubuntu 16.04. This may be a systemd issues. Should my fstab config work? Do you mount nfs in a different way these days? I found several reports about similar problems of other users at other forums. Should I file a bug?

Thank you for your answer!

Best Answer

I found the following solution here. Apparrently, you have to use specific systemd options in fstab.

servername:/home   /mountpoint/on/client  nfs  noauto,x-systemd.automount,x-systemd.device-timeout=10,timeo=14,x-systemd.idle-timeout=1min 0 0
Related Question