NFS won't mount on boot

  • 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?

    • Official Post

    I've never bothered with the 'new' mounting process in LibreELEC. Simply only placing a mount command in autostart.sh is enough for me, along with having "Wait for network" enabled for 30 secs (RPIs with wifi are sometimes slow). As an example:

    Code
    mount -t nfs 192.168.62.342:/media/disks/bigone/KODI/PLAYLISTS /storage/playlists
  • I've already tried adding the mount command to autostart.sh, as well as a delay in case the network isn't up yet. The mountpoint is an empty folder after boot. If I SSH in and run autostart.sh it works perfectly. My Pi is connected to Ethernet, not WiFi.

  • Try adding this dependency to service:

    Code
    After=time-sync.target

    To enable DHCP logging in connman create:

    Code: /storage/.config/system.d/connman.service.d/debug.conf
    [Service]
    Environment=CONNMAN_DHCP_DEBUG=1

    Use journalctl to see logging and to look for errors and the start order.

  • Try adding this dependency to service:

    Code
    After=time-sync.target

    That worked, thank you!

    For reference, this is what I ended up with:

    Just wondering what device you use as a NFS server...?

    I'm using Ubuntu Server 18.04 here.

    I'm using Ubuntu Server 18.04 as well.