Not able to mount NFS share in kodi
#1
Hi,
I am using a Thecus NAS to store movies and music. I have installed kodi 17.6 krypton on ubuntu 18.04 server. But when i am trying to add NFS share in kodi by browsing in add videos section, it shows the following error in kodi.log.
Also i am able to successfully mount that share in the same ubuntu machine.
The error is

15:40:10.815 T:140649105979136   DEBUG: NFS: Context for 192.168.0.219/raid0/data/_NAS_NFS_Exports_/Videos not open - get a new context.
15:40:10.818 T:140649105979136   ERROR: NFS: Failed to mount nfs share: /raid0/data/_NAS_NFS_Exports_/Videos (mount/mnt call failed with "RPC error: Mount failed with error MNT3ERR_ACCES(13) Permission denied(13)")
15:40:10.818 T:140650643708032   ERROR: GetDirectory - Error getting nfs://192.168.0.219/raid0/data/_NAS_NFS_Exports_/Videos/
15:40:10.818 T:140650643708032   ERROR: CGUIDialogFileBrowser::GetDirectory(nfs://192.168.0.219/raid0/data/_NAS_NFS_Exports_/Videos/) failed
Reply
#2
What does your exports file on the Thecus look like?

And next time, please use a pastebin website for providing your full kodi.log file (notice the red text above the Post button). Don't splash a single piece of the puzzle directly onto the forum.
Reply
#3
Okay, i will use pastebin from now onwards

and exports look like

showmount -e 192.168.0.219
Export list for 192.168.0.219:
/raid0/data/_NAS_NFS_Exports_/entertainment *
/raid0/data/_NAS_NFS_Exports_               *
/raid0/data/_NAS_NFS_Exports_/Videos        (everyone)
/raid0/data/_NAS_NFS_Exports_/Movies MKV    (everyone)
Reply
#4
Not what I was expecting... Usually the /etc/exports file on the server contains settings on how the NFS share is configured.

My example in Ubuntu:

xml:
klojum@srvr:~$ cat /etc/exports
# /etc/exports: the access control list for filesystems which may be exported
# to NFS clients. See exports(5).
#
# Example for NFSv2 and NFSv3:
# /srv/homes hostname1(rw,sync,no_subtree_check) hostname2(ro,sync,no_subtree_check)
#
# Example for NFSv4:
# /srv/nfs4 gss/krb5i(rw,sync,fsid=0,crossmnt,no_subtree_check)
# /srv/nfs4/homes gss/krb5i(rw,sync,no_subtree_check)
#
/media/disks/40TB00 192.168.1.0/24(rw,nohide,insecure,no_subtree_check,async,all_squash)
Reply
#5
The output of cat /etc/exports is

N4510U-S:~# cat /etc/exports 
"/raid0/data/_NAS_NFS_Exports_" *(rw,fsid=0,insecure,hide,root_squash,sync,subtree_check,anonuid=99,anongid=99)
"/raid0/data/_NAS_NFS_Exports_/entertainment" *(rw,fsid=1,root_squash,secure,async,anonuid=99,anongid=99,no_subtree_check)
"/raid0/data/_NAS_NFS_Exports_/Movies MKV" *(rw,fsid=2,root_squash,secure,async,anonuid=99,anongid=99,no_subtree_check)
"/raid0/data/_NAS_NFS_Exports_/Movies MKV" 192.168.0.49(rw,fsid=3,root_squash,secure,async,anonuid=99,anongid=99,no_subtree_check)
"/raid0/data/_NAS_NFS_Exports_/Movies MKV" 192.168.0.4(rw,fsid=5,no_root_squash,secure,async,anonuid=99,anongid=99,no_subtree_check)
"/raid0/data/_NAS_NFS_Exports_/Videos" *(rw,fsid=6,root_squash,secure,async,anonuid=99,anongid=99,no_subtree_check)
"/raid0/data/_NAS_NFS_Exports_/Videos" 192.168.0.4(rw,fsid=7,root_squash,secure,async,anonuid=99,anongid=99,no_subtree_check)
N4510U-S:~#
Reply
#6
(2018-12-18, 13:11)Dhimant Wrote: "/raid0/data/_NAS_NFS_Exports_" *(rw,fsid=0,insecure,hide,root_squash,sync,subtree_check,anonuid=99,anongid=99)
"/raid0/data/_NAS_NFS_Exports_/entertainment" *(rw,fsid=1,root_squash,secure,async,anonuid=99,anongid=99,no_subtree_check)
"/raid0/data/_NAS_NFS_Exports_/Movies MKV" *(rw,fsid=2,root_squash,secure,async,anonuid=99,anongid=99,no_subtree_check)
"/raid0/data/_NAS_NFS_Exports_/Movies MKV" 192.168.0.49(rw,fsid=3,root_squash,secure,async,anonuid=99,anongid=99,no_subtree_check)
"/raid0/data/_NAS_NFS_Exports_/Movies MKV" 192.168.0.4(rw,fsid=5,no_root_squash,secure,async,anonuid=99,anongid=99,no_subtree_check)
"/raid0/data/_NAS_NFS_Exports_/Videos" *(rw,fsid=6,root_squash,secure,async,anonuid=99,anongid=99,no_subtree_check)
"/raid0/data/_NAS_NFS_Exports_/Videos" 192.168.0.4(rw,fsid=7,root_squash,secure,async,anonuid=99,anongid=99,no_subtree_check)

Are all your target users in the 192.168.0.* range? As an aside, it is recommended to export from the NFS root rather than the live filesystem. If your NAS supports it, bind mount each of the live mounts to something like /srv/nfs/foo and /srv/nfs/bar in the future.

I am unfamiliar with some of the options you selected.  For reference on my server:
Code:
/srv/nfs        10.1.10.0/24(ro,fsid=root,no_subtree_check)
/srv/nfs/foo    10.1.10.0/24(ro,no_subtree_check,insecure)
/srv/nfs/bar    10.1.10.0/24(ro,no_subtree_check,insecure)
Need help programming a Streamzap remote?
Reply
#7
Yes all my target users are in the range 192.168.0.*

Also i am able to mount my nfs share on the ubuntu system on which i have installed kodi, but kodi cannot add those nfs shares.
When i click on browse, i select NFS shares, I then select the ip of NAS i.e. 192.168.0.219.
It shows me the folders which i have listed earlier Movies MKV, entertainment, videos with their path raid0/data/_NAS_NFS_Exports_/....
But when i select any one of those folders, nothing happens on screen but in logs the earlier mentioned error is reported. So there must be some configuration to be done in kodi or in NAS (particularly for kodi)??
Reply
#8
(2018-12-18, 14:01)Dhimant Wrote: It shows me the folders which i have listed earlier Movies MKV, entertainment, videos with their path raid0/data/_NAS_NFS_Exports_/....
But when i select any one of those folders, nothing happens on screen but in logs the earlier mentioned error is reported
Some years ago, Synology NAS'es needed the 'insecure_locks' parameter instead of just 'insecure' to solve something similar.
Not sure if your 'hide' parameter is causing trouble.

If Ubuntu does the NFS connection to your NAS, Kodi should simply follow orders and use that connection.

Quote:/srv/nfs 10.1.10.0/24(ro,fsid=root,no_subtree_check)
It is a read-only share, but I don't think that using root as a user for network connections is a good measure in terms of safety/security in any situation. But that's just me. Wink
Reply
#9
(2018-12-18, 15:57)Klojum Wrote:
Code:
/srv/nfs 10.1.10.0/24(ro,fsid=root,no_subtree_check)
It is a read-only share, but I don't think that using root as a user for network connections is a good measure in terms of safety/security in any situation. But that's just me. Wink       

The fsid= parameter refers to the root of all exported filesystems, not to a user. See man 5 exports for more.
man 5 exports Wrote:fsid=num|root|uuid
NFS needs to be able to identify each filesystem that it exports. Normally it will use a UUID for the filesystem (if the filesystem has such a thing) or the device number of the device holding the filesystem (if the filesystem is stored on the device).

As not all filesystems are stored on devices, and not all filesystems have UUIDs, it is sometimes necessary to explicitly tell NFS how to identify a filesystem. This is done with the fsid= option.

For NFSv4, there is a distinguished filesystem which is the root of all exported filesystem. This is specified with fsid=root or fsid=0 both of which mean exactly the same thing.

Other filesystems can be identified with a small integer, or a UUID which should contain 32 hex digits and arbitrary punctuation.

OFF-TOPIC:
As I suggested above, bind mounting the file system to the NFS root is a good security strategy.

/etc/exports:
Code:
/srv/nfs 10.1.10.0/24(ro,fsid=root,no_subtree_check)
/srv/nfs/foo 10.1.10.0/24(ro,no_subtree_check,insecure)
/srv/nfs/bar 10.1.10.0/24(ro,no_subtree_check,insecure)

/etc/fstab:
Code:
/mnt/data/foo /srv/nfs/foo none ro,bind 0 0
/mnt/data/bar /srv/nfs/bar none ro,bind 0 0
Need help programming a Streamzap remote?
Reply
#10
(2018-12-18, 12:20)Dhimant Wrote: I have installed kodi 17.6 krypton on ubuntu 18.04 server.

May I ask if you used the Kodi ppa to install 17.6 or did you got it from the Ubuntu PPA? If you got it from the Ubuntu ppa, please use the version from the Kodi ppa: ppa:team-xbmc/ppa
(2018-12-18, 12:20)Dhimant Wrote: Also i am able to successfully mount that share in the same ubuntu machine.

Could you please mount the share at the OS level and then please share: mount | nc termbin.com 9999

I'm interested in, if it's a NFSv3 or a NFSv4 share.

you could also try to: rpcinfo -p {server} which will give you an output like that:
Quote:$ rpcinfo -p localhost
program vers proto port
100000 2 tcp 111 portmapper
100000 2 udp 111 portmapper
...
100003 2 tcp 2049 nfs
100003 3 tcp 2049 nfs
100003 4 tcp 2049 nfs
100003 2 udp 2049 nfs
100003 3 udp 2049 nfs
100003 4 udp 2049 nfs
...

to see which versions are offered by the server.
Reply
#11
By default, if the server supports NFSv4 and you mount an nfs share on Ubuntu with: mount -t nfs <server-IP>:/some/share /to/mountpoint you will get an NFSv4 mount:


That's the output of my "mount" command for that share:

192.168.253.202:/volume1/DaVu on /media/DaVu type nfs4 (rw,relatime,vers=4.0,rsize=131072,wsize=131072,namlen=255,hard,proto=tcp,port=0,timeo=600,retrans=2,sec=sys,clientaddr=192.168.253.108,local_lock=none,addr=192.168.253.202)

If you use mount -t nfs -o nfsvers=3 <server-IP>:/some/share /to/mountpoint you will get a NFSv3 share:

192.168.253.202:/volume1/DaVu on /media/DaVu type nfs (rw,relatime,vers=3,rsize=131072,wsize=131072,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=192.168.253.202,mountvers=3,mountport=892,mountproto=udp,local_lock=none,addr=192.168.253.202)
Reply
#12
(2018-12-18, 14:01)Dhimant Wrote: Also i am able to mount my nfs share on the ubuntu system on which i have installed kodi, but kodi cannot add those nfs shares.
Bit late to the party, but FWIW I had some issues with Kodi doing the mounts so did them at OS level (in /etc/fstab) so that they were available once the OS had booted and Kodi just looked at (what appeared to be) local directories.

Not sure if this helps your situation or not, but I access the same content outside of Kodi so didn't let Kodi handle it all.
Reply

Logout Mark Read Team Forum Stats Members Help
Not able to mount NFS share in kodi0