I'm trying to mount an NFS share on /storage/NFS on a Pi 4 running LibreELEC 9.2.6. I've made a storage-NFS.mount file following the template, and it works great when I run systemctl start storage-NFS.mount. However, even after running systemctl enable storage-NFS.mount and making sure the symlink is created in multi-user.target.wants, it won't work at boot. I've tried with and without the network-online.service parts, as suggested in this thread. I've even put it in /storage/.config/autostart.sh, which is chmod +x and works when I run it manually, but won't run (or can't get network) at boot, despite adding a delay as suggested on the wiki here and even after adding a while loop that greps ifconfig to make sure the Ethernet interface is up.
I have no problems mounting NFS on boot with any other distro, or dealing with systemd, but this just isn't working and I'm stumped. Does anyone have any suggestions?
/storage/.config/system.d/storage-NFS.mount:
[Unit]
Description=nfs mount script
Requires=network-online.service # Behaves the same with
After=network-online.service # or without these two lines
Before=kodi.service
[Mount]
What=192.168.1.10:/storage/media
Where=/storage/NFS
Options=
Type=nfs
[Install]
WantedBy=network-online.target # I've tried switching
WantedBy=multi-user.target # between both of these
Display More
/storage/.config/autostart.sh:
#!/bin/bash
(
sleep 5
while ! ifconfig | grep -F "UP BROADCAST RUNNING MULTICAST" > /dev/null; do
sleep 1
done
echo "Network seems up, mounting NFS"
mount -t nfs 192.168.1.10:/storage/media /storage/NFS
)&
Display More