Mapped NFS Share - Problem Traversing Directories

I have a small home network with “NAS” hosting NFS shares along with a central database serving 2 S905x boxes running Coreelec.
Both client machines run the current version - 8.95.6

One of the NFS shares contains 286 directories. About 50% of the time navigating to this shares via the Video / Files dialogue will result in a failure to read … which then disables all NFS shares on that client for a period. NFS seems to recycle after a while (not sure how long … 5 minutes ?) and then all is ok

I’ve tried various share options in /etc/exports on the host, none seem to help. Current settings are

/mnt/dvd_tv 192.168.0.43/32(ro,insecure,async,no_root_squash,no_subtree_check,nohide)

Here’s the first NFS error from the log

09:04:30.787 T:3850171248 ERROR: GetDirectory - Error getting nfs://192.168.0.13/mnt/dvd_tv/tv_downloads/11_22_63/

Log is available here https://pastebin.com/vM1TnTGQ

Thanks for help / advice

I don’t know what NAS you have, I have a synology, this guide is pretty much what I followed.

https://www.synology.com/en-uk/knowledgebase/DSM/tutorial/File_Sharing/How_to_access_files_on_Synology_NAS_within_the_local_network_NFS

It means, that whenever I install libre/core elec, it has access to my nas via nfs.

I didn’t need to write any commands

thanks Bubblegum

My “NAS” is a J4015-itx" based machine, running KUbuntu minimal, with 8GB of RAM and 5 disks in non-RAID
It also hosts a few containers
CPU and RAM are way overkill for current duties, it’s idling
Nett - full linux with plenty of processing power
Seems to be a problem with one particular share. That share is a >5TB LVM hosted EXT4 partition on a Seagate st6000dm003 (SMR drive I think … which shouldn’t matter for “read” operations) … there’s no other activity on the drive and it’s rarely written to (twice a day by CRON initiated jobs within containers)

I looked at some of the Synology setup instructions & discussion but couldn’t find anything that seemed to help.
There is one other layer of complexity in that there are multiple clients for that share, some of which need write access so there are actually 2 export “definitions” in normal operation, one for Coreelec (read only) and one for others. But I have tested both styles for Coreelec (and prevented other clients access to ensure a “clean” test)
The problem arises on both coreelec clients.
I have not seriously considered spinning up a Kodi container to test a “wintel build” to see if this is a Kodi problem (vs Coreelec) … but I have searhced the Kodi and Libreelec forum info without finding anything relevant.
Wondering if it’s just me :thinking:

For the moment I have

  • Changed /storage/.config/autostart.sh to create new directories at /media/zkodi_client and mount the sources there
  • Changed /storage/.kodi/userdata/sources.xml to point to the new sources
  • Dropped the video database (kodi-video112) and rebooted Coreelec to re-add an empty database
  • Edited the data source definitions in the /video/files dialog to (a) set the file type (movies or tv) (b) rescan each defined source

Seems much more stable and I have a bit more control over the mount parameters (if needed).

I have alo reset my “watched” history by reloading the prior version of the “files” table (as “zz_files”) and then updating the new version based on filename ie.

UPDATE kodi-video112.files
INNER JOIN kodi-video112.zz_files ON files.strFilename = zz_files.strFilename
SET files.playCount = zz_files.playCount, files.lastPlayed = zz_files.lastPlayed
WHERE NOT (zz_files.playCount IS NULL AND zz_files.lastPlayed IS NULL);

seems to have worked well enough to be going on with

One other point - My wirelessly connected client seemed to take a long time to complete the NFS mounts (executed in autostart.sh) so I had to add a few “sleep 1” lines between creating mounts and before script completion

I use this and works:
1- create folder /storage/nfs
2- create file /storage/.config/system.d/storage-nfs.mount with content
#====================================================
[Unit]
Description=movies nfs mac osx
Requires=network-online.service
After=network-online.service
Before=kodi.service

[Mount]
What=192.168.0.4:/Volumes/1T1/MOVIES/
Where=/storage/nfs/
Options=
Type=nfs

[Install]
WantedBy=multi-user.target
#====================================================
3- systemctl status storage-nfs.mount
4- systemctl enable storage-nfs.mount
5- reboot

Good idea, thanks. I’ll give it a whirl :wink:

That worked :grinning:

With a few modifications / notes

  1. Unit files must be placed in /storage/.config/system.d
  2. Mount unit file names must be of form “dir-subdir-subdir.mount” ie. the unit names reflects the mount point name (fully qualified target directory name) subdirectory names should not contain dashes and the “slashes” in a fully qualified directory name are converted to “dashes”
  3. A target directory must be a “real” directory and not a link. In my case mounting to “/media” actually requires mounting to “/var/media” ie. the “real” directory that “/media” points to

Once that’s sorted and I enabled the units eg.

systemctl enable var-media-zkodi_client-dvd_movies

It all works nicely. Much cleaner than using autostart
Thanks for the advice :+1:

PS Here’s a sample unit file from /storage/.config/system.d/var-media-zkodi_client-dvd_movies.mount

#====================================================
[Unit]
Description=movies nfs mounts for video
Requires=network-online.service
After=network-online.service
Before=kodi.service

[Mount]
What=192.168.0.13:/mnt/dvd_movies
Where=/var/media/zkodi_client/dvd_movies
Options=
Type=nfs

[Install]
WantedBy=multi-user.target
#====================================================

yes /storage/.config/system.d/storage-nfs.mount

var-media-nfs.mount (more appropriate)

2- create file /storage/.config/system.d/ var-media-nfs.mount with content
#====================================================
[Unit]
Description=movies nfs mac osx
Requires=network-online.service
After=network-online.service
Before=kodi.service

[Mount]
What=192.168.0.4:/Volumes/1T1/MOVIES/
Where=/var/media/nfs/
Options=
Type=nfs

[Install]
WantedBy=multi-user.target
#====================================================
3- systemctl status var-media-nfs.mount
4- systemctl enable var-media-nfs.mount
5- reboot

After reboot… ls -al /var/media/

1 Like