OSMC Alpha 2: Problem mounting nfs share at boot via fstab

Running OSMC Alpha 2. (same problem with Alpha 1).
I cannot get my nfs share to mount at boot.

I have added the folowing to /etc/fstab:
‘ /home/osmc/tank nfs rw,nolock 0 0’

I have created the folder /home/osmc/tank.
Running ‘sudo mount -a’ mounts the share fine.

What am I doing wrong?


1 Like

Try this
‘ /home/osmc/tank nfs rw,nolock,_netdev 0 0’

_netdev should make it wait for the network to come up, I’m assuming that it’s running fstab before the network connection is established

adding _netdev made no difference.
Still have to run ‘sudo mount -a’ after the pi has booted up.

This worked in raspbmc but not i OSMC Alpha1 or 2.

osmc@pi-sovrum:~$ sudo mount -a -v
/boot : already mounted
/ : ignored
mount.nfs: timeout set for Sat Dec 27 17:54:00 2014
mount.nfs: trying text-based options ‘nolock,vers=4,addr=,clientaddr=’
mount.nfs: mount(2): Protocol not supported
mount.nfs: trying text-based options ‘nolock,addr=’
mount.nfs: prog 100003, trying vers=3, prot=6
mount.nfs: trying prog 100003 vers 3 prot TCP port 2049
mount.nfs: prog 100005, trying vers=3, prot=17
mount.nfs: trying prog 100005 vers 3 prot UDP port 990
/home/osmc/tank : successfully mounted

_netdev should work but …
Looking at above you need a “nfsvers=3” at least, see here for other options http://linux.die.net/man/5/nfs and here http://linux.die.net/man/8/mount

In a previous post DBMandrake mentioned you should use ‘x-systemd.automount, noauto’ instead of ‘_netdev, auto, or bg’, I did and it works perfectly! :smile:


That worked for me too! Thanks a lot for the help!

1 Like

Automounting at boot using mount.nfs can be a bit finicky, depending on the many variables involved(nfs version, ext2/3/4, permissions, etc) it might be worth sharing your working /etc/fstab config here and referencing the hardware used. My setup:

  • Pi model B
  • OSMC Alpha 3
  • USB Wifi dongle and D-Link DNS 321(sad piece of hardware, I know)

I needed to declare fewer options to make it work and after some testing, eventually landed on this functional /etc/fstab line: /nas/mount nfs defaults,nolock,x-systemd.automount

1 Like

I’ve tried mounting using nfsvers=3 and it seems to crash the mounts. They mount, but as soon as I try read or copy files from the mountpoint osmc locks up and I have to reboot. Removing the nfsvers=3 flag seems to resolve the issue. Mostly, I was trying to run nfsvers=3 and set the protocol to UDP as I have had good performance results with those flags on raspbmc.

So at present this works reliably for me:

192.168.x.x:/e/Videos/ /mnt/nfs-foo     nfs      lookupcache=none,noatime,rsize=32768,defaults,nolock,x-systemd.automount       0 0

However this seems to have problems:

192.168.x.x:/e/Videos/ /mnt/nfs-foo     nfs      nfsvers=3,proto=udp,lookupcache=none,noatime,rsize=32768,defaults,nolock,x-systemd.automount       0 0

I’m on RC1. None of the above options seem to work for me. :worried:

Had a similar issue and this line worked for me too, Thanks

Same here. not working for me either. Has anyone found a solution yet?

We don’t support Alpha2 anymore. A “me too!” without some valid description of some issue that doesn’t include logs demonstrating a problem is of no diagnostic use.

fair enough. I’ve rebuilt my OSMC-based RPi2 about a month ago so I should have whatever was the latest then. If there is a way to check what version I’m on please tell me and i’ll let you know.

As for the me too, I’m trying to mount a network share using fstab using the following line
//server/share /mnt/share nfs defaults,nolock,x-systemd.automount 0 0
After i rebooted a couple of times I checked using df -h and it’s not mounted. I’m not sure where to look for fstab errors log any advice would be appreciated.


Thanks but the link is to kodi and dmesg. Neither of which contain fstab-related logs. If anyone is able to help, I would be most grateful.

sudo journalctl | paste-log

Provide the resulting URL please.

paste-log: command not found. I think i’m going to rebuild my RPi2 and try again. I’ve tried apt-get update then apt-get upgrade and that seems to time out as well. I’ll post an update once done. Ta

This syntax doesn’t look right to me for mounting an nfs share with fstab.

Try something like this: /mnt/share nfs hard,sync,intr,rw,x-systemd.automount,noauto