ok i managed to solve the problem with the following way.
created 2 files on
/etc/systemd/system
with the following names:
- folder-that-i-want-to-mount-my-share.mount
- folder-that-i-want-to-mount-my-share.automount
contents of 1st file:
[Unit]
Description=Mount NFS share
After=network-online.target
Wants=network-online.target
[Mount]
What=ip address of share:/my/share
Where=/folder/that/i/want/to/mount/my/share
Options=auto,nofail,noatime,nolock,intr,tcp,actimeo=1800
Type=nfs
TimeoutSec=60
[Install]
WantedBy=multi-user.target
contents of 2nd file:
[Unit]
Description=NFS share mount
[Automount]
Where=/folder/that/i/want/to/mount/my/share
TimeoutIdSec=60
[Install]
WantedBy=multi-user.target
then we need to reload the daemon so
sudo systemctl daemon-reload
Then we have to start and enable the two mounts that we have created.
sudo systemctl enable folder-that-i-want-to-mount-my-share.mount --now
sudo systemctl enable folder-that-i-want-to-mount-my-share.automount --now
Now in every reboot my share is mounted automatically.