Ubuntu NFS Server Problem

I have Ubuntu 20.04 media server, firewall disabled. When I browse for NFS servers in Kodi it doesnt see any.

# cat /etc/exports
/MOVIES *(ro,insecure)

When I do the same on my CentOS-7.8 pc the Kodi NFS browser sees it.

Are there other options I need to put on the Ubuntu export line?

Why does CentOS work but not Ubuntu?

Thanks.

Please show the output of the following commands on both of your servers.
nfsstat -c
rpcinfo -p localhost

Ubuntu:
root@supermicro:~# nfsstat -c
Error: No Client Stats (/proc/net/rpc/nfs: No such file or directory).
root@supermicro:~# rpcinfo -p localhost
program vers proto port service
100000 4 tcp 111 portmapper
100000 3 tcp 111 portmapper
100000 2 tcp 111 portmapper
100000 4 udp 111 portmapper
100000 3 udp 111 portmapper
100000 2 udp 111 portmapper
100005 1 udp 41765 mountd
100005 1 tcp 55503 mountd
100005 2 udp 52445 mountd
100005 2 tcp 49869 mountd
100005 3 udp 46050 mountd
100005 3 tcp 47429 mountd
100003 3 tcp 2049 nfs
100003 4 tcp 2049 nfs
100227 3 tcp 2049
100003 3 udp 2049 nfs
100227 3 udp 2049
100021 1 udp 44129 nlockmgr
100021 3 udp 44129 nlockmgr
100021 4 udp 44129 nlockmgr
100021 1 tcp 33791 nlockmgr
100021 3 tcp 33791 nlockmgr
100021 4 tcp 33791 nlockmgr

CentOS:
[root@centos7 /]# nfsstat -c
Client rpc stats:
calls retrans authrefrsh
28 0 28

Client nfs v4:
null read write commit open open_conf
0 0% 0 0% 0 0% 0 0% 0 0% 0 0%
open_noat open_dgrd close setattr fsinfo renew
0 0% 0 0% 0 0% 0 0% 3 11% 0 0%
setclntid confirm lock lockt locku access
0 0% 0 0% 0 0% 0 0% 0 0% 2 7%
getattr lookup lookup_root remove rename link
5 19% 2 7% 1 3% 0 0% 0 0% 0 0%
symlink create pathconf statfs readlink readdir
0 0% 0 0% 2 7% 0 0% 0 0% 1 3%
server_caps delegreturn getacl setacl fs_locations rel_lkowner
5 19% 0 0% 0 0% 0 0% 0 0% 0 0%
secinfo exchange_id create_ses destroy_ses sequence get_lease_t
0 0% 0 0% 1 3% 1 3% 1 3% 0 0%
reclaim_comp layoutget getdevinfo layoutcommit layoutreturn getdevlist
0 0% 1 3% 0 0% 0 0% 0 0% 0 0%
(null)
1 3%

[root@centos7 /]# rpcinfo -p localhost
program vers proto port service
100000 4 tcp 111 portmapper
100000 3 tcp 111 portmapper
100000 2 tcp 111 portmapper
100000 4 udp 111 portmapper
100000 3 udp 111 portmapper
100000 2 udp 111 portmapper
100024 1 udp 48816 status
100024 1 tcp 52622 status
100005 1 udp 20048 mountd
100005 1 tcp 20048 mountd
100005 2 udp 20048 mountd
100005 2 tcp 20048 mountd
100005 3 udp 20048 mountd
100005 3 tcp 20048 mountd
100003 3 tcp 2049 nfs
100003 4 tcp 2049 nfs
100227 3 tcp 2049 nfs_acl
100003 3 udp 2049 nfs
100003 4 udp 2049 nfs
100227 3 udp 2049 nfs_acl
100021 1 udp 48422 nlockmgr
100021 3 udp 48422 nlockmgr
100021 4 udp 48422 nlockmgr
100021 1 tcp 39621 nlockmgr
100021 3 tcp 39621 nlockmgr
100021 4 tcp 39621 nlockmgr

Could you please try to add vers=3 as a parameter to your exports file on Ubuntu?
If that doesn’t work, try it with vers=4.

I think the vers=X is a client option, not a server option.

The NFS browser used to work with my Ubuntu server, I used it in the past on my older coreelec Kodi boxes. Im building a new coreelec Kodi box and now it doesnt work.

Sorry, you are right about it being a client option.
At least both servers seem to support NFS3 and NFS4.

Are you able to access the NFS share on your Ubuntu server from any other machine (e.g. from your CentOS server)?

Please try the following exports contents and restart your NFS server afterwards:
/MOVIES *(ro,insecure,no_subtree_check,no_root_squash)

If that doesn’t work, maybe your nfs server logs contain some useful information, why the connection fails.

sm is the ubuntu server. No problems mounting it from CentOS-7.

[root@centos7 /]# mount sm:/MOVIES /Z
[root@centos7 /]# mount
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
devtmpfs on /dev type devtmpfs (rw,nosuid,size=8142140k,nr_inodes=2035535,mode=755)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,nodev,mode=755)
.
.
.
fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime)
nfsd on /proc/fs/nfsd type nfsd (rw,relatime)
sm:/MOVIES on /Z type nfs4 (rw,relatime,vers=4.1,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=192.168.100.245,local_lock=none,addr=192.168.100.241)
[root@centos7 /]# ls -1 /Z
007
101GOPRO
A-C
Animation
D-R
S-S
T-Z

Did you try the exports contents I’ve posted above?

root@supermicro:~# cat /etc/exports

/MOVIES *(ro,insecure,no_subtree_check,no_root_squash)

Nothing in your server logs while connecting from Kodi?
Are you able to mount it directly on the OS level (on the CE device)?

I was going to try that on an hour when I’m off work.

It works from the shell.

CoreELEC:~ # mkdir Z
CoreELEC:~ # mount 192.168.100.241:/MOVIES Z
CoreELEC:~ # ls Z
007
101GOPRO
A-C
Animation
D-R
S-S
T-Z

I installed LibreElec & OSMC on a RPi 3, both have the same issue, so this is probably a Kodi problem, not a problem specific to Coreelec.

Kodi is very picky about NFS share configurations.
Because it works on the OS, I would just permanently mount it there and use the local mount point in Kodi instead.

Where should I mount it to? I assume I can edit /etc/fstab & put the mounts in there.
I made a post to Kodi.tv forums, see if I get anything from them.

You could use a systemd service to mount it.

nano /storage/.config/system.d/storage-movies.mount

[Unit]
Description=nfs mount script
Before=kodi.service

[Mount]
What=192.168.100.241:/MOVIES
Where=/storage/movies
Options=
Type=nfs

[Install]
WantedBy=multi-user.target

Start it to test this service:
systemctl start storage-movies.mount

If it works enable it to start on boot:
systemctl enable storage-movies.mount

I ssh’d to an old Kodi box that has the Ubuntu server mounted back when the NFS browser worked.
I dont see anything mounted from the Ubuntu server (from the mount command), yet it is playing content from /MOVIES.

Yes, because Kodi itself is using it as a source, which doesn’t need it to be mounted.
You can keep on playing around with your exports options (maybe user mapping is necessary), but the easy way would be the automatic mount using systemd.

So Kodi is actually doing the NFS mount, not the underlying OS, I get it.
I’ll try the systemd mount.
Thanks for your help & knowledge.
Im a UNIX/Linux Administrator w/ 25 years of experience, I love these Libreelec / OSMC / Coreelec dists that have Linux as the underlying OS, being able to ssh in & see whats going on in the background.

About | FAQ | Terms of Service | Privacy Policy | Legal Notice