Wait NFS server until ready

Hello,

I need that all my clients wait until NFS server is ready (sometimes, in some reboots, clients reboot faster than server and, then, NFS mountpoints are not mounted).
I have reconfigured file /etc/nfsmount.conf in clients, enabling “Retry=10” (in minutes; by default, value is 2). However, running a test shuting down server and rebooting client, it continues waiting only 2 minutes (exaclty: 1m33seconds), so NFS mountpoint is not correctly mounted.

How can I solve it?

Thanks.

Could automount , i.e. delayed mount suffice?

One could have in /etc/fstab:

server:/share /data/volume nfs defaults,tcp,port=2049,acl,noauto,nofail,x-systemd.automount,x-systemd.idle-timeout=300 0 0

and SystemD would do the mount when you try to access /data/volume.

Alternatively, with autofs:

$ cat /etc/auto.master.d/local.autofs
/data    /etc/auto.master.d/auto.data    --timeout=300 browse
$ cat /etc/auto.master.d/auto.data
volume -fstype=nfs,rw,hard,nodev,nosuid,acl,proto=tcp,port=2049 server:/share

Naturally, if the mount is so critical that the system cannot boot without the volume mounted, then these are “too late”.

1 Like