NFS server behind firewall

Here it is. What is the correct syntax for the “nfs version” parameter? is it “nfsvers” or “nfsver”? I tried both, result is similar:

$ sudo mount -v -t nfs -o nfsvers=4.2 hroch:/export/video1 /mnt/video1
mount.nfs: timeout set for Mon Oct 15 18:13:21 2018
mount.nfs: trying text-based options 'nfsvers=4.2,addr=10.0.0.3,clientaddr=10.0.0.240'
mount.nfs: mount(2): Invalid argument
mount.nfs: an incorrect mount option was specified

.

sudo mount -v -t nfs -o nfsver=4.2 nas:/export/video /mnt/video
mount.nfs: timeout set for Mon Oct 15 18:14:36 2018
mount.nfs: trying text-based options 'nfsver=4.2,vers=4.2,addr=10.0.0.3,clientaddr=10.0.0.240'
mount.nfs: mount(2): Invalid argument
mount.nfs: trying text-based options 'nfsver=4.2,vers=4.1,addr=10.0.0.3,clientaddr=10.0.0.240'
mount.nfs: mount(2): Invalid argument
mount.nfs: trying text-based options 'nfsver=4.2,vers=4.0,addr=10.0.0.3,clientaddr=10.0.0.240'
mount.nfs: mount(2): Invalid argument
mount.nfs: trying text-based options 'nfsver=4.2,addr=10.0.0.3'
mount.nfs: prog 100003, trying vers=3, prot=6
mount.nfs: trying 10.0.0.3 prog 100003 vers 3 prot TCP port 2049
mount.nfs: prog 100005, trying vers=3, prot=17
mount.nfs: trying 10.0.0.3 prog 100005 vers 3 prot UDP port 56021
mount.nfs: mount(2): Invalid argument
mount.nfs: an incorrect mount option was specified

.

$ sudo mount -v -t nfs -o nfsver=4.1 nas:/export/video /mnt/video
mount.nfs: timeout set for Mon Oct 15 18:18:22 2018
mount.nfs: trying text-based options 'nfsver=4.1,vers=4.2,addr=10.0.0.3,clientaddr=10.0.0.240'
mount.nfs: mount(2): Invalid argument
mount.nfs: trying text-based options 'nfsver=4.1,vers=4.1,addr=10.0.0.3,clientaddr=10.0.0.240'
mount.nfs: mount(2): Invalid argument
mount.nfs: trying text-based options 'nfsver=4.1,vers=4.0,addr=10.0.0.3,clientaddr=10.0.0.240'
mount.nfs: mount(2): Invalid argument
mount.nfs: trying text-based options 'nfsver=4.1,addr=10.0.0.3'
mount.nfs: prog 100003, trying vers=3, prot=6
mount.nfs: trying 10.0.0.3 prog 100003 vers 3 prot TCP port 2049
mount.nfs: prog 100005, trying vers=3, prot=17
mount.nfs: trying 10.0.0.3 prog 100005 vers 3 prot UDP port 56021
mount.nfs: mount(2): Invalid argument
mount.nfs: an incorrect mount option was specified

.

$ sudo mount -v -t nfs -o nfsver=4.0 nas:/export/video /mnt/video
mount.nfs: timeout set for Mon Oct 15 18:19:16 2018
mount.nfs: trying text-based options 'nfsver=4.0,vers=4.2,addr=10.0.0.3,clientaddr=10.0.0.240'
mount.nfs: mount(2): Invalid argument
mount.nfs: trying text-based options 'nfsver=4.0,vers=4.1,addr=10.0.0.3,clientaddr=10.0.0.240'
mount.nfs: mount(2): Invalid argument
mount.nfs: trying text-based options 'nfsver=4.0,vers=4.0,addr=10.0.0.3,clientaddr=10.0.0.240'
mount.nfs: mount(2): Invalid argument
mount.nfs: trying text-based options 'nfsver=4.0,addr=10.0.0.3'
mount.nfs: prog 100003, trying vers=3, prot=6
mount.nfs: trying 10.0.0.3 prog 100003 vers 3 prot TCP port 2049
mount.nfs: prog 100005, trying vers=3, prot=17
mount.nfs: trying 10.0.0.3 prog 100005 vers 3 prot UDP port 56021
mount.nfs: mount(2): Invalid argument
mount.nfs: an incorrect mount option was specified

Please note I tried this with Vero on the same network as nas (10.0.0.0/24) - none of above mount commands was successful.
When I left out the -o nvsver(s) option, mount negotiated v3 and succeeded.

nfsvers (with an s at the end)

root@osmc-vero4k:/mnt# mount -v -t nfs -o nfsvers=4.0 synology-ds214se:/volume1/music /mnt/blubb
mount.nfs: timeout set for Mon Oct 15 18:31:37 2018
mount.nfs: trying text-based options 'nfsvers=4.0,addr=192.168.178.106,clientaddr=192.168.178.44'

There should be only nfsvers=4.x in the displayed options.
Your Ubuntu client does not seem to to use/transmit any version string … :thinking:

You should look at the NFS server side what is logged there.

The thing is that I get the mount.nfs: mount(2): Invalid argument error every time either nfsvers=... or vers=...parameter is passed:

mount.nfs4: trying text-based options 'vers=4.2,addr=10.0.0.3,clientaddr=192.168.100.240'
mount.nfs4: mount(2): Invalid argument

.

mount.nfs: trying text-based options 'nfsvers=4.2,addr=10.0.0.3,clientaddr=10.0.0.240'
mount.nfs: mount(2): Invalid argument

So it is these two arguments that are “Invalid”. The mount(2) function in osmc does not recognize these parameters. So these requests do not pass through the mount(2) so do not get to the NFS server until the client falls back to v3.

@JimKnopf
Could you please try to mout your Synology share from stable release of osmc and check you get the same output as I do? In case you do, then we rule out my NAS. Though I do not mind to try whatever you need me to try if that helps…

Sorry, that would mean a re-install of one of my systems and I do not have enough time for this.

Others with a stable OSMC release and a NFSv4 capable NAS are welcome to try this.

Here’s a Debian jessie box running nfs server up to v4.1:

$ sudo cat /proc/fs/nfsd/versions 
+2 +3 +4 +4.1 -4.2

From a Pi running stable OSMC:

osmc@osmc:~$ sudo mount -v -t nfs -o nfsvers=4.1 192.168.8.3:/mnt/usbdrive2 /mnt/test
mount.nfs: timeout set for Mon Oct 15 17:31:51 2018
mount.nfs: trying text-based options 'nfsvers=4.1,addr=192.168.8.3,clientaddr=192.168.8.33'
osmc@osmc:~$ mount|grep /mnt/test
192.168.8.3:/mnt/usbdrive2 on /mnt/test 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.8.33,local_lock=none,addr=192.168.8.3)

Looks fine to me. Do we have any details of the NAS in question?

1 Like

Ok, installed a Pi3B with stable OSMC 2018.08-01 from scratch:

root@osmc-pi3:/mnt# mkdir blubb
root@osmc-pi3:/mnt# mount -v -t nfs -o nfsvers=4.0 synology-ds214se:/volume1/music /mnt/blubb
mount.nfs: timeout set for Mon Oct 15 19:37:02 2018
mount.nfs: trying text-based options 'nfsvers=4.0,addr=192.168.178.106,clientaddr=192.168.178.10'
root@osmc-pi3:/mnt# cd blubb
root@osmc-pi3:/mnt/blubb# ls
AC-DC
…

Hi,

My Synology supprts nfs up to 4.1 and I’m on stable on vero4k, just tried a couple of @JimKnopf suggestions:

sudo mount -v -t nfs -o nfsvers=4.1 192.168.1.21:/volume1/music /mnt/music
mount.nfs: timeout set for Mon Oct 15 19:37:38 2018
mount.nfs: trying text-based options 'nfsvers=4.1,addr=192.168.1.21,clientaddr=192.168.1.15'

sudo mount -v -t nfs -o nfsvers=4.0 192.168.1.21:/volume1/music /mnt/music
mount.nfs: timeout set for Mon Oct 15 19:34:35 2018
mount.nfs: trying text-based options 'nfsvers=4.0,addr=192.168.1.21,clientaddr=192.168.1.15'

Both mounted with no issues.

Thanks Tom.

1 Like

Just to push this question.

Yes, thanks to all for your help by the way. My NAS is just a regular Ubuntu Server 18.04. It does support NFSv4 based on this:

$ 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  36731  mountd
    100005    1   tcp  46157  mountd
    100005    2   udp  60646  mountd
    100005    2   tcp  57395  mountd
    100005    3   udp  56021  mountd
    100005    3   tcp  39801  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  35152  nlockmgr
    100021    3   udp  35152  nlockmgr
    100021    4   udp  35152  nlockmgr
    100021    1   tcp  42255  nlockmgr
    100021    3   tcp  42255  nlockmgr
    100021    4   tcp  42255  nlockmgr

Also when I mount folder from this server on Ubundu Desktop, it shows it is using NFSv4:

$ nfsstat -c
Client rpc stats:
calls      retrans    authrefrsh
188        0          188     

Client nfs v4:
null             read             write            commit           open             
0         0%     0         0%     0         0%     0         0%     0         0%
...

Here is how my /etc/exports looks like:

/export/video        10.0.0.0/24(rw,sync,no_wdelay,no_subtree_check,insecure_locks,all_squash,anonuid=1000,anongid=100) 192.168.100.0/24(rw,sync,no_wdelay,no_subtree_check,insecure_locks,all_squash,anonuid=1000,anongid=100)

@Tom_Doyle , what is your OSMC version? Mine says:
Linux osmc 3.14.29-117-osmc #1 SMP Mon Sep 3 00:16:47 UTC 2018 aarch64

@glypto On the Vero could you show the output of

mount.nfs4 -V

My Vero4k on staging shows

mount.nfs4: (linux nfs-utils 1.3.3)

Same here: mount.nfs4: (linux nfs-utils 1.3.3)

Just to compare, if something is different, we need to wait for some guys with a Vero 4k on stable release:

root@osmc-vero4k:/mnt# cksum /sbin/mount.nfs4
761036281 72292 /sbin/mount.nfs4

root@osmc-vero4k:/mnt# cksum /sbin/mount.nfs
761036281 72292 /sbin/mount.nfs

root@osmc-vero4k:/mnt# mount -V
mount from util-linux 2.29.2 (libmount 2.29.2: selinux, btrfs, assert, debug)
root@osmc-vero4k:/mnt# cksum /bin/mount
4171541951 30832 /bin/mount

Hi,

I believe both my vero4ks are on Linux osmc 3.14.29-117-osmc #1 SMP Mon Sep 3 00:16:47 UTC 2018 aarch64, but I will double check this evening.

@JimKnopf will run the cksum checks this evening.

Thanks Tom.

I haven’t been following this but get the same:

Linux vero4tv 3.14.29-117-osmc #1 SMP Mon Sep 3 00:16:47 UTC 2018 aarch64

osmc@vero4tv:~$ cksum /sbin/mount.nfs4
761036281 72292 /sbin/mount.nfs4
osmc@vero4tv:~$ cksum /sbin/mount.nfs
761036281 72292 /sbin/mount.nfs
osmc@vero4tv:~$ mount -V
mount from util-linux 2.29.2 (libmount 2.29.2: selinux, btrfs, assert, debug)
osmc@vero4tv:~$ cksum /bin/mount
4171541951 30832 /bin/mount
osmc@osmc:~$ cksum /sbin/mount.nfs4
761036281 72292 /sbin/mount.nfs4

osmc@osmc:~$ cksum /sbin/mount.nfs
761036281 72292 /sbin/mount.nfs

osmc@osmc:~$ cksum /bin/mount
4171541951 30832 /bin/mount

osmc@osmc:~$ mount -V
mount from util-linux 2.29.2 (libmount 2.29.2: selinux, btrfs, assert, debug)

Looks like the nfsv4 mount fails because of the TCP protocol. Look into this output, even nfsv3 fails over TCP, it is only after it tries UDP it successfully mounts. NFSv4 is only over TCP that’s why all v4 attempts fail:

osmc@osmc:~$ sudo mount -v -t nfs4 10.0.0.3:/export/video1 /mnt/video3
mount.nfs4: timeout set for Tue Oct 16 17:16:27 2018
mount.nfs4: trying text-based options 'vers=4.2,addr=10.0.0.3,clientaddr=10.0.0.240'
mount.nfs4: mount(2): Invalid argument
mount.nfs4: trying text-based options 'vers=4.1,addr=10.0.0.3,clientaddr=10.0.0.240'
mount.nfs4: mount(2): Invalid argument
mount.nfs4: trying text-based options 'vers=4.0,addr=10.0.0.3,clientaddr=10.0.0.240'
mount.nfs4: mount(2): Invalid argument
mount.nfs4: trying text-based options 'addr=10.0.0.3'
mount.nfs4: prog 100003, trying vers=3, prot=6
mount.nfs4: trying 10.0.0.3 prog 100003 vers 3 prot TCP port 2049
mount.nfs4: prog 100005, trying vers=3, prot=17
mount.nfs4: trying 10.0.0.3 prog 100005 vers 3 prot UDP port 56021

Have you tried to telnet to the box on port 2049 and see what happens?

1 Like
osmc@osmc:~$ telnet nas 2049
Trying 10.0.0.3...
Connected to nas.
Escape character is '^]'.
^]
Connection closed by foreign host.