I’ve updated today my old RPi1 that I use as a file server to stretch.
After that update, the external hdds physically connected on this RPi are not being mounted as a NFS share at boot.
here is the output.
systemctl status nfs-server.service
nfs-server.service - NFS server and services
Loaded: loaded (/lib/systemd/system/nfs-server.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Thu 2018-01-11 21:05:49 -03; 1min 9s ago
Process: 388 ExecStartPre=/usr/sbin/exportfs -r (code=exited, status=1/FAILURE)
Jan 11 21:05:49 osmc systemd[1]: Starting NFS server and services…
Jan 11 21:05:49 osmc exportfs[388]: exportfs: Failed to stat /media/hdd1: No such file or directory
Jan 11 21:05:49 osmc exportfs[388]: exportfs: Failed to stat /media/hdd2: No such file or directory
Jan 11 21:05:49 osmc systemd[1]: nfs-server.service: Control process exited, code=exited status=1
Jan 11 21:05:49 osmc systemd[1]: Failed to start NFS server and services.
Jan 11 21:05:50 osmc systemd[1]: nfs-server.service: Unit entered failed state.
Jan 11 21:05:50 osmc systemd[1]: nfs-server.service: Failed with result ‘exit-code’.
I can mount these hdd drivers by restarting the nfs-kernel-server.
I’m wondering what changed that is not working now?
Same problem happens to me with the latest OSMC upgrade (stretch).
It seems the nfs server can’t mount from /media on boot, probably because this is a temporary fs system.
I can manually mount my external drive, and can manually restart the nfs-kernel-server successfully.
But it fails to mount on boot.
This is my fstab: UUID=a1c124-8591-44124-b11b-421ifasq12e8c /mnt/usb ext4 defaults,noatim,eauto,nofail,x-systemd.mount-timeout=60 0 0
My exports:
/mnt/usb/remote *(rw,sync,no_root_squash,no_subtree_check)
service status:
* nfs-server.service - NFS server and services
Loaded: loaded (/lib/systemd/system/nfs-server.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sat 2018-01-13 00:03:48 CST; 17min ago
Process: 365 ExecStartPre=/usr/sbin/exportfs -r (code=exited, status=1/FAILURE)
Jan 13 00:03:47 osmc systemd[1]: Starting NFS server and services...
Jan 13 00:03:47 osmc exportfs[365]: exportfs: Failed to stat /mnt/usb/remote: No such file or directory
Jan 13 00:03:47 osmc2 systemd[1]: nfs-server.service: Control process exited, code=exited status=1
Jan 13 00:03:48 osmc systemd[1]: Failed to start NFS server and services.
Jan 13 00:03:48 osmc systemd[1]: nfs-server.service: Unit entered failed state.
Jan 13 00:03:48 osmc systemd[1]: nfs-server.service: Failed with result 'exit-code'.
My setup is exactly like yours except I’m not trying to share a directory under the mount point. I share the mount point itself. I think that exists even before the disk has mounted, whereas your system has to wait for remote to exist before nfs can do its stuff.
That is, I’m using Option 1 of the post quoted above.
● nfs-server.service - NFS server and services
Loaded: loaded (/lib/systemd/system/nfs-server.service; enabled; vendor preset: enabled)
Active: active (exited) since Fri 2018-01-12 17:34:57 GMT; 12min ago
Process: 420 ExecStart=/usr/sbin/rpc.nfsd $RPCNFSDARGS (code=exited, status=0/SUCCESS)
Process: 345 ExecStartPre=/usr/sbin/exportfs -r (code=exited, status=0/SUCCESS)
Main PID: 420 (code=exited, status=0/SUCCESS)
CGroup: /system.slice/nfs-server.service
Jan 12 17:34:55 osmc systemd[1]: Starting NFS server and services...
Jan 12 17:34:57 osmc systemd[1]: Started NFS server and services.
Output from showmount:
Export list for osmc:
/mnt/nfstest/testdir1 192.168.8.0/24
Te device is just a USB pendrive. I tested with an export of the mount-point and with a subdirectory - and both worked.
I hadn’t updated OSMC in a year, so I just did and now I’m getting this problem - NFS doesn’t work unless I manually start it once boot is completed.
I’ve tried everything I can find:
add “service nfs-kernel-server restart” to rc.local
add “@reboot service nfs-kernel-server restart” to sudo crontab
increased “sleep” in /etc/init.d/nfs-kernel-server
Add a /etc/systemd/system/nfs-kernel-server.service.d/10-dep.conf with “[Unit] requires=rpcbind.service After=rpcbind.service”
The only thing that I can get to work is logging in manually and running “sudo service nfs-kernel-server start”.
Note that I’m not actually mounting the NFS share as a drive, just using it as a source in the video library.