How to automount NFS-export when server comes online AFTER the client has booted?

Viewed 17

My server is not always on. It is just switched on 'when needed'. So, in many cases my client is booted long before the server. (Both are running ubuntu 22.04)

Mounting the shares at boottime of the client then logically fails. Consequently, I have to manually issue the 'mount -a' command. I find that annoying.

I now have a cronjob scanning for the server and, when found, mounting the share. It works, but it feels like a somewhat clunky solution.

Is there a neat way not to do that manually, but automatically? So that the mount takes place as soon as the server is booted ?

Note: The share on the server is an NFS export !

FYI

This is my server export:

/var/nfs/general    192.168.1.0/255.255.255.0(no_subtree_check,rw,sync,nohide)
/home               192.168.1.0/255.255.255.0(no_subtree_check,rw,no_root_squash,sync)

And this is the clients fstab:

venus:/var/nfs/general    /nfs/general   nfs auto,nofail,noatime,nolock,intr,tcp,actimeo=1800 0 0
venus:/home               /nfs/home      nfs auto,nofail,noatime,nolock,intr,tcp,actimeo=1800 0 0
0 Answers
Related