D&C GLug - Home Page

[ Date Index ] [ Thread Index ] [ <= Previous by date / thread ] [ Next by date / thread => ]

Re: [LUG] systemd and NFS shares

 

On 28/08/2021 14:43, Julian Hall wrote:
Hi All,

After several months in hospital - having simply turned my PC off when I last used it - I had the expectation that it would work when i powered it back up. After all the PC when off shouldn't care if the next time it is turned on is a minute or a month later. The NAS shares however refuse to mount properly.


Hope you're feeling better after getting back out of hospital chief.

You and NFS shares between that NAS and your Mint PC have a loooooong history don't they? We seem to have done this several times before at this point...

Delete ALL of the old crap - get rid of the weird .mount and .automount files, clean fstab and check through your systemd units to find and remove any old references.

Add this as a one-liner for each share you want to add to /etc/fstab:

192.168.1.2:/NFSSHARE /mountpoint/on/client nfs _netdev,noauto,x-systemd.automount,x-systemd.mount-timeout=10,timeo=14,x-systemd.idle-timeout=1min 0 0

Then either reboot or run:

sudo systemctl daemon-reload
sudo systemctl restart remote-fs.target

That'll sort you out and provide on-access instant mounting of the NFS share(s). If you insist on having desktop icon shortcuts to the shared drives then fair enough - get rid of whatever is there now and issue per share:

ln -s /mountpoint/on/client /home/julian/Desktop/

That will give you an old fashioned symbolic link to the shares and clicking on them will trigger the automount behaviour through the fstab entry which seems to be what you want.

It is a bit weird that after just a short period sitting your PC's existing mount setup had stopped working - did you immediately run a big fat apt upgrade on it perhaps and update a ton of software once you started using it again? Maybe in those months of software upgrades there was a systemd upgrade or something that retired the mount behaviour you were using... ¯\_(ツ)_/¯

--
The Mailing List for the Devon & Cornwall LUG
https://mailman.dcglug.org.uk/listinfo/list
FAQ: http://www.dcglug.org.uk/listfaq