Boot Fails when NFS mount is unavailable LE 11.01

  • To preface, I am running LE 11.01 on 2 devices being a Tanix TX6-A and a Raspberry Pi 4. I am experiencing 2 different issues but I believe they fall in the same category.

    I have 2 NFSv4 shares exported from a server on my network. I am from an area that experiences regular power outages and the server that exports the NFS shares does not turn on immediately (there is a delay after power returns due to a surge protector). These shares are mounted using mount files and systemd as per the LibreElec documentation.

    The Raspberry Pi 4 halts boot after the NFS shares fail to mount and stays in text output (Kodi doesn't start) until the server is running and I reboot.

    The Tanix TX6-A boots successfully into Kodi but reports that the files are missing (even after the server is turned on - I presume it does not retry the mount) until the server is running and I reboot.

    Even if the server did turn on immediately I'm fairly certain LibreElec will fail to mount the shares before the server completes it's boot sequence. Is there any way to combat this? My only solution would be to script something to check whether or not the server is exporting the shares before connecting but I'm not sure how well that would work. I'd like Kodi to start regardless (like how the Tanix TX6 behaves and mount the share when it's available (if that's possible).

  • I have a history of answering my own questions on this forum but here goes.

    I found this in the Linux man-pages. It's not quite a retry in the sense that it will continuously retry until a connection is made. However, it does work as intended and here's why:

    Because we enable the automount service, we can disable the mount service. Which in turn allows the system to boot without errors, even if the network share is not available (it will still show the files as missing until the share is available, but this is expected). What the automount does is try to connect to the network share when the local mount folder is accessed by the filesystem. So when trying to play media from the mount folder, or trying to update the library (assuming the mounted folder is in your media library). Including instructions below in case this helps someone.

    After following the LibreElec documentation for mounting network shares here you end up with an enabled systemd service called storage-recordings.mount (following the example from the docs).

    You need to disable this service:

    Code
    systemctl disable storage-recordings.mount

    Create the automount service:

    Code
    nano .config/system.d/storage-recordings.automount

    With the following contents:

    Enable the service:

    Code
    systemctl enable storage-recordings.automount

    Finally reload the daemon to apply changes (or alternatively, reboot the system):

    Code
    systemctl daemon-reload

    Voila! No more fuss about network shares.

  • And that’s exactly how a project like LE continues to evolve. Research and contribute. Maybe you should research a little deeper before asking the question in the first place.

  • And that’s exactly how a project like LE continues to evolve. Research and contribute. Maybe you should research a little deeper before asking the question in the first place.

    I always try to do this. I end up doing more research than I have time for, posting the question because I'm at my wits end and then solving the problem immediately after posting the question.

    To be fair, I was even more confused by the difference in behaviour between devices and found many instances online of people who never solved similar issues this gracefully, or at all. The only solutions I found were messy retry scripts (what I was trying to avoid). Maybe I was asking the wrong questions? I have noted your comment and will try harder next time, but I'm kind of glad I didn't for this one because at least it's on the internet now and not just in my head.

    Long live LibreElec!