NFS mounting issues

Hi,

first of all: installed OSMC on my brand new RPi 2 - and it’s GREAT! I’m looking forward supporting you to get it out of alpha asap (currently using Aplha 4)

So here’s my first finding:
On the old RPi I used an NFS mount on OS level (instead the NFS link within XBMC/Kodi) as it was significantly faster and enabled me to run HD movies without issues.

No surprise, this is still a bottleneck on the RPi2 so I took over the fstab entry from the old RPi to the new RPi 2:

192.168.0.156:/Multimedia /mnt/Multimedia nfs proto=tcp,rsize=32768,timeo=6,retrans=9,nouser,atime,auto,rw,dev,exec,suid,nolock 0 0

(BTW: proto and rsize are a result of heavy individual testing and proven to work best in MY environment, may not apply to others)

Problems:

  • the NFS share does not mount automatically on boot (error message is displayed, saying something of “check systemctl status mnt-Multimedia.mount for more details”
  • accessing the NFS share (once manually mounted) results in a freeze/crash after a couple of seconds (scanning the library). Network connection is dropped, screen is frozen

Searching this forum I found a slightly different fstab

192.168.0.156:/Multimedia /mnt/Multimedia nfs defaults,nolock,x-systemd.automount

which does resolve the freeze problem but still does not mount on boot

1 Like

Mine does mount on boot:

x.x.x.x:/volume1/kodi	/mnt/kodi	nfs	noexec,nosuid,nodev,noauto,noatime,rsize=16384,wsize=16384,intr,x-systemd.automount	0 0

Ohoh, now it freezes shortly after boot - now I’ve to find a way to fix this … :frowning:

Update: edited fstab before next freeze, safe again …

Did not automount with this:

xxx.xxx.xxx.xxx:/volume1/xbmc             /media/nfs-syn     nfs     _netdev,defaults,user,auto,noatime,intr  0 0

Had to add x-systemd.automount for it to work.

xxx.xxx.xxx.xxx:/volume1/xbmc             /media/nfs-syn     nfs     _netdev,defaults,user,auto,noatime,intr,x-systemd.automount 0 0
1 Like

Stupid me. I did not realize that the share does not show up in “df” until it’s accessed. I saw the error message during boot, the missing entry in “df” after boot and did not investigate further

The last option worked for me but the other one might have solved it, too - but I’m not going to re-verify it because of plain lazyness …

So the last thing to solve is the persisting freeze issue …

Update: The freeze issue seems somehow related to Confluence which I was using for historical reasons. Switching to OSMC seems to solve this issue

1 Like

@Errik so which options are you using succesfully now?

Sorry for the delay - I hope you found your answers in the meatime. If not, here’s what I did:

xxx.xxx.xxx.xxx:/Multimedia /mnt/Multimedia nfs rsize=8192,tcp,cto,noatime,intr,x-systemd.automount,noauto,nfsvers=3 0 0

One note:
Usually, NFS performs better with UDP. This is not the case in my setup. Rsize and tcp options are the results of a number of test runs I’ve performed with different settings. Wsize did not have much effect in my setup, so I did not run additional tests with different wsizes. On the RPI 2, rsize does not seem to count that much anymore, but tcp still makes a big difference.

It’s a good idea to run your own tests do identify the optimum settings.

I grabbed a small script from somewhere and modified it to my requirements (very, very dirty). Basically, it does the following:

  • loop over different rsize values
  • mount the nfs share
  • perform a dd for a (large) testfile
  • measure and output the duration and performance
  • unmount the nfs share

EXPORT=“xxx.xxx.xxx.xxx:/”
MNTDIR=""
TESTFILE=""

NFSPROTO=“tcp”

echo “Testing transfer speed of $NFSPROTO on file $EXPORT/$TESTFILE”
echo

for rsize in 8192 16384 32768 65536 131072 262144
do
if mount | grep $MNTDIR > /dev/null; then
sudo umount $MNTDIR
fi

sudo mount -t nfs -o timeo=6,retrans=9,nolock,rsize=$rsize,wsize=32768,$NFSPROTO,cto,noatime,intr, $EXPORT $MNTDIR
cat /proc/mounts | grep $MNTDIR

echo $MNTDIR mounted @ rsize ($((mntedrsize/1024))K), requested rsize ($((rsize/1024))K)

sudo dd if=$MNTDIR/$TESTFILE of=/dev/null | grep “copied”

echo
done

sudo umount $MNTDIR

1 Like

What finally worked for me was:

_netdev,defaults,user,noatime,intr,x-systemd.automount,noauto