OSMC Installing but not booting via NFS

Greetings,

I have an RPI 3 and i wanted to install OSMC on this device.

However for performance i wanted to put the boot info on the SD card and the OS to run via NFS. But i’m having a very troublesome problem.

I’ve tried all combinations that i can think of (in terms of mount options in exports).

OSMC will boot initially and install the OS files (i can see them on the share) yet after reboot i get these errors and nothing much happens:

http://imgur.com/a/GQlzN

The server that is running the NFS share is Debian Jessie:

Linux version 3.16.0-4-amd64 (debian-kernel@lists.debian.org) (gcc version 4.8.4 (Debian 4.8.4-1) ) #1 SMP Debian 3.16.7-ckt25-1 (2016-03-06)

This is my NFS share config:
/media/storage/osmc_boot 192.168.1.3(rw,fsid=0,async,no_root_squash,no_all_squash,no_subtree_check,insecure)

The NFS share is a created on a mountpoint on my software raid (mdadm) running XFS filesystem.

The IP listed above IS the RPI (configured via DHCP reservation)

This is are the folder permissions on the nfs presented share.
drwxrwxrwx 22 root root 4.0K Jul 27 13:01 osmc_boot

As said, OSMC does install on first boot and appears to put its files correctly in the folders.

root@arkp-nas:/media/storage/osmc_boot# ls -lh
total 36K
drwxr-xr-x 2 root root 4.0K Jul 27 12:57 bin
drwxr-xr-x 2 root root 10 Jul 27 13:02 boot
drwxr-xr-x 4 root root 4.0K Jul 27 12:57 dev
drwxr-xr-x 67 root root 4.0K Jul 27 13:03 etc
drwxr-xr-x 3 root root 25 Jul 27 12:57 home
drwxr-xr-x 15 root root 4.0K Jul 27 12:58 lib
drwxr-xr-x 2 root root 10 Mar 2 00:45 lib64
drwxr-xr-x 2 root root 27 Jul 27 12:58 media
drwxr-xr-x 2 root root 10 Jun 21 16:16 mnt
drwxr-xr-x 3 root root 23 Jul 27 12:58 opt
drwxr-xr-x 2 root root 10 May 30 05:40 proc
drwx------ 2 root root 47 Jul 27 12:58 root
drwxr-xr-x 5 root root 71 Jul 27 12:58 run
drwxr-xr-x 2 root root 4.0K Jul 27 12:58 sbin
drwxr-xr-x 2 root root 10 Mar 2 00:45 selinux
drwxr-xr-x 2 root root 10 Jun 21 16:16 srv
drwxr-xr-x 2 root root 10 Apr 6 2015 sys
drwxrwxrwt 7 root root 132 Jul 27 13:12 tmp
drwxr-xr-x 12 root root 4.0K Jul 27 13:01 usr
drwxr-xr-x 11 root root 4.0K Jul 27 13:02 var

When i am eventually able to login to the RPI and check the services like it says, i get the following error:

osmc@osmc:~$ systemctl status systemd-journal-flush.service
Failed to get properties: Connection timed out

Does anyone have any suggestions what to check? It sounds like a permissions problem, but i’ve tried with 777 all the way down just in case and i’ve re-imaged the card multiple times after each config change to either NFS or something else. Each time i’ve also removed the osmc boot folder and re-created.

I must be missing something, however the googling of errors doesn’t appear to help me with the scenario i’m in.

Any comments or suggestions welcome. Happy to provide anymore info if required

Performance is not really enhanced by using NFS root anymore. That was the case some time ago but that time has passed.

Good to know, however i’d still like to continue on my current approach.

Any suggestions?

It never really offered better performance. It offered some shielding against corruption however.

Use:

(rw,async,no_root_squash,no_subtree_check,insecure)

And reinstall.

Thanks Sam, i’ll give that a try.

According to some docs is read, i need to keep fsid=0 because i use XFS. Without that i was unable to get OSMC to install itself to the NFS drive.

Would that also be your view? (i’ll try this now)

My understanding is fsid=0 is used to stop NFSv4 clients seeing other exports.

OSMC’s installer uses NFSv3 for the best compatibility with legacy systems.

mountProcess.start("/bin/mount -t nfs -o nolock,noatime,vers=3 " + device->getRoot().toLocal8Bit() + " " +  MNT_ROOT);

Further, the kernel is patched to attempt to use a v3 mount as the default option

diff --git a/fs/nfs/nfsroot.c b/fs/nfs/nfsroot.c
index cd3c910..139e2bd 100644
--- a/fs/nfs/nfsroot.c
+++ b/fs/nfs/nfsroot.c
@@ -87,7 +87,7 @@
 #define NFS_ROOT        "/tftpboot/%s"
 
 /* Default NFSROOT mount options. */
-#define NFS_DEF_OPTIONS        "vers=2,udp,rsize=4096,wsize=4096"
+#define NFS_DEF_OPTIONS        "vers=3,udp,rsize=4096,wsize=4096"
 
 /* Parameters passed from the kernel command line */
static char nfs_root_parms[256] __initdata = "";

I haven’t used XFS in years though, as I found it’s resizing abilities quite lacking.

Sam

ah, excellent.

Thanks for the info. I’ll take a further look and report back :slight_smile:

Hi Sam

As soon as i remove fsid=0 i get “Install failed: Can’t mount root”

With that enabled i am able to mount root and install, but then it crashes again after its done the first part.

Are there any further configuration steps you think i need? Some further logs i could get to try and figure out why this wont play nice.

Do we have any ideas why this still fails to work? I’d love to get it working.

Not really. I would dd a 2GB file and mkfs.ext4 on it and mount it loopback. Set up your export on the mounted directory and see if that works better (may show XFS to be the issue).

Ok Sam, Thanks. I’ll report back if i find the problem

Just to confirm, using an ex4 NFS share with the following setup (basically as per your suggestions)

adam@arkp-nas:~$ ls -lh | grep osmc_boot
drwxrwxrwx 22 nobody nogroup 4.0K Aug 6 11:17 osmc_boot

adam@arkp-nas:~$ cat /etc/exports | grep ‘/home/adam/’
/home/adam/osmc_boot 192.168.1.3(rw,async,no_root_squash,no_subtree_check,insecure)
adam@arkp-nas:~$

Is now working. So it must be something to do with XFS, either way im not fussed in this instance. Thanks for your help!