D&C GLug - Home Page

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

Re: [LUG] Linux Mint 20 and autofs [trying to mount NFS shares on NAS]

 

On 16/07/2020 17:32, comrade meowski wrote:
On 16/07/2020 12:20, Julian Hall wrote:
The .mount / .automount solution works perfectly on my desktop - currently Mint 19.3 - so there is no reason - or at least /none I could see/ which is nowhere near the same thing - for that not to work on the laptop, which at the time also had Mint 19.3 installed. As it wasn't working /anyway/ that was when I installed Mint 20 and discovered the autofs solution, which on paper looks tidier. I even found a YouTube video of Linux Mint showing how to install autofs. Except as usual - you know me by now - what works for them doesn't work for me. The way I /think/ autofs is supposed to work is that auto.master tells it the root mount point - in my case /media/julian - and auto.nfsdb tells it the individual mount points such as DEMETER to dynamically create the mount point(s) /media/julian/DEMETER. In principle that /sounds/ like it should work.

Unless you particularly want to learn autofs just for the fun of it I'd back out now, wipe it and go back to copying/adapting the known working - and preferred - systemd automount way.

To my knowledge the syntax and methodology haven't changed at all so just repeat what you did last time - or copy the setup instructions from the Arch wiki, they work perfectly. If you get into problems post a summary of the information like IPs and mountpoints and include the systemd units you create. It's probably one tiny thing like forgetting the systemd units have a super strict naming policy that _must_ match their mountpoints, accounting for the weird systemd-escape conventions. For automount to work, you have to disable the normal mount unit you'd have just written and probably enabled.

The next most likely explanation is that you need to specify an after= and/or requires= argument in the systemd units, Mint may be firing them too early in the boot sequence to activate (like before the network is ready for example).

i don't especially want to learn autofs when the current system works perfectly well on the desktop, and used to on the laptop. What changed / corrupted I have no idea but it won't work now :/

I copied / pasted the mount and automount files from the desktop, so the exact files which work on the desktop do not on the laptop. Example below:

media-julian-DEMETER.mount

[Unit]
Description=DEMETER
After=network.target

[Mount]
What=192.168.1.3:/volume1/DEMETER
Where=/media/julian/DEMETER
Type=nfs
Options=_netdev,auto

[Install]
WantedBy=multi-user.target

media-julian-DEMETER.automount

[Unit]
Description=Automount DEMETER NFS

[Automount]
Where=/media/julian/DEMETER

[Install]

WantedBy=multi-user.target

------------------

I have since tried adding them to the fstab, which I then added to the list of methods that don't work. However trying to mount them manually using 'sudo mount -a' gave an access denied error, which may well be the root of all the problems, and I have no clue what that's about.

Kind regards,

Julian

--
“The great tragedy of Science — the slaying of a beautiful hypothesis by an ugly 
fact.”

― Thomas Henry Huxley


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