Jun 14 21:38:51 osmc mount[269]: mount.nfs: Network is unreachable
Jun 14 21:38:51 osmc systemd[1]: mnt-oracle.mount mount process exited, code=exited status=32
Jun 14 21:38:51 osmc systemd[1]: Failed to mount /mnt/oracle.
Jun 14 21:38:51 osmc systemd[1]: Unit mnt-oracle.mount entered failed state.
They propose to use the mount options _netdev or x-systemd.automount,noauto. The first one (_netdev) does not help. The second one does suppress the error message - but also the mounting. The “noauto” option will just cause it not to be automatically mounted.
For testing, I created an /etc/network/interfaces (auto eth0; allow-hotplug eth0; iface eth0 inet dhcp) - the network still comes up as before, but didn’t help with the nfs share. I also tried to enter the mount commands into the /etc/rc.local, but that resulted in the same “mount.nfs: Network is unreachable” error.
I believe this to be a bug - the system should know it needs a running networking before it can even try to mount nfs shares. (I think I’m using RC3.)
_netdev is wrong, the correct options to use with systemd are x-systemd.automount,noauto and yes it does work.
OSMC doesn’t support /etc/network/interfaces because we use connman not network manager, so you’re wasting your time going in that direction.
Trying to use rc.local will also not work because rc.local does not wait for the network to come up.
There is no bug there - you’re just not using the right mount options for systemd. Forget everything you learnt on other systems - systemd does not handle network mounts the same as other init systems, which means 90% of the tutorials and recommended settings out there are wrong for systemd.
x-systemd.automount in fstab creates a systemd automount unit on the fly which handles on-demand mounting:
You can also enable wait for network in the GUI which will cause any services that declare dependencies on network-online.target to be delayed until the network is actually up (this includes Kodi) but this isn’t really neccessary for x-systemd.automount because it is both on demand and has a built in retry mechanism. Even without wait for the network enabled it will automatically retry until the network is up.
Yes, indeed! What I didn’t know: it mounts the thing on demand! After boot I checked df -h and the output of mount, but my nfs share didn’t show up. Only after e.g. ls /mnt/oracle/ it gets mounted in the background. (I guess any comment on that design idea goes into the systemd holy wars, which is not the topic here )
So, you’re right. The following line in my /etc/fstab does work as designed:
Would there be any options to add, to speed up the NFS somehow we should use ? especially when using WiFI ?
I already have the IR repeat/not working issue (during the caching phase)…