Description=Music folder mounted via NFS from Tower unRaid.
DefaultDependencies=no
After=network.target
[Mount]
What=192.168.0.245:/mnt/disks/Expansion1/Music
Where=/mnt/Tower/Music
Type=nfs
Options=_netdev,auto
[Install]
WantedBy=multi-user.target
with corresponding .automount:
[[Unit]
Description=Automount music mount from unRaid tower
ConditionPathExists=/mnt/Tower/Music
[Automount]
Where=/mnt/Tower/Music
TimeoutIdleSec=10
[Install]
WantedBy=multi-user.target
As subject states, the mount isn’t working on reboot. If I manually mount, things go smoothly. System hangs for about 30-60 seconds since I added the two files to /etc/systemd/system folder.
[EDIT]
Resolved with above advice combined. Thanks all.
[/EDIT]
Wow I miss the days of good old init and fstab editing
Ok so some of the edits made were just typos (missed copy/paste). The [unit] errors caught weren’t errors, just fat fingers when I was copying to the forum post.
I’ve done the remaining changes other than
nfs-client.target
How do I go about doing this? Really appreciate it. 20 years of Linux and still learning a thing or two.
You can still do that (use fstab), but not if you want to use the automount function (mounts first when access is requested).
sudo systemctl enable --now nfs-client.target
But now that I type that I get unsure if that is actually needed, it might get started anyway by other units. Hopefully someone will correct me if I am wrong with this.
Technically you can - by combining a a heap of options - but in my experience it is error prone - in fact the systemd mount topics was born out of my frustration with my nfs mounts in fstab.
Either they didn’t mount or the system was completely random hung because the network was not available …
I noticed that too when changing from samba to NFS for my network drive when mounting it directly with the mount unit at boot instead of using an automount unit.
I added Requisite=network-online.target in the mount unit, and have never had any problems since.
Might just be a coincidence and have nothing to do with it, but just in case, the option doesn’t hurt.