nfsv4 problems

George Kyriazis

Dabbler
Joined
Sep 3, 2013
Messages
42
Hi guys,

I am running 11.2-U2.1, and I am trying to set up NFSv4 on a work environment.

I have clicked "Enable NFSv4" and "NFSv3 ownership model for NFSv4" (note: just trying this now; eventually I would like to set up Kerberos).

Testing a mount from CentOS 7, I am getting the following:

[root@frontend /]# mount -v -t nfs4 10.123.110.11:/mnt/vol/test /mnt/
mount.nfs4: timeout set for Mon Mar 18 21:36:52 2019
mount.nfs4: trying text-based options 'vers=4.1,addr=10.123.110.11,clientaddr=10.123.110.71'
mount.nfs4: mount(2): Protocol not supported
mount.nfs4: trying text-based options 'vers=4.0,addr=10.123.110.11,clientaddr=10.123.110.71'
mount.nfs4: mount(2): Protocol not supported
mount.nfs4: Protocol not supported
[root@frontend /]# mount -v 10.123.110.11:/mnt/vol/test /mnt/
mount.nfs: timeout set for Mon Mar 18 21:36:58 2019
mount.nfs: trying text-based options 'vers=4.1,addr=10.123.110.11,clientaddr=10.123.110.71'
mount.nfs: mount(2): Protocol not supported
mount.nfs: trying text-based options 'vers=4.0,addr=10.123.110.11,clientaddr=10.123.110.71'
mount.nfs: mount(2): Protocol not supported
mount.nfs: trying text-based options 'addr=10.123.110.11'
mount.nfs: prog 100003, trying vers=3, prot=6
mount.nfs: trying 10.123.110.11 prog 100003 vers 3 prot TCP port 2049
mount.nfs: prog 100005, trying vers=3, prot=17
mount.nfs: trying 10.123.110.11 prog 100005 vers 3 prot UDP port 945
[root@frontend /]#

and it gets mounted as nfsv3.

On the FreeNAS box, I see:

Mar 18 19:55:15 nas nfsd: can't register svc name

So, it looks like nfsv4 did not get enabled. Any ideas as to what could be wrong?

Thanks!
 

KrisBee

Wizard
Joined
Mar 20, 2017
Messages
1,288
That error message doesn't mean NFSv4 is not enabled, see: https://redmine.ixsystems.com/issues/11351

Check the output of cat /etc/exports on your FreeNAS box to ensure you have NFSv4 exports with sec=sys ( see man exports ).
If the FN server config is correct, then you need to sort out your Centos 7 nfs client config.
 

George Kyriazis

Dabbler
Joined
Sep 3, 2013
Messages
42
Yes, there is a line specifying V4 in /etc/exports.

Does FreeNAS's nfs server negotiate nfsv3 when doing sec=sys (ie. falling back to nfsv3), or does it still do nfsv4?
 

KrisBee

Wizard
Joined
Mar 20, 2017
Messages
1,288
The sec=sys setting just means kerberos is not in use and when you chose the ""NFSv3 ownership model for NFSv4" FreeNAS sets appropriate values for tunables "uidtostring" & "stringtouid" in the background and nfsuserd is not started, so the client doesn't have to use idmapping and can still make a nfsv4 connection.

E.g:
Code:
[chris@freenas ~]$ cat /etc/exports
V4: / -sec=sys
/mnt/NasPool/topdataset -maproot="root":"wheel" -network 192.168.0.0/24

root@debianbox:/# mount -vvvv -t nfs 192.168.0.56:/mnt/NasPool/topdataset /home/chris/NFS
mount.nfs: timeout set for Tue Mar 19 20:03:02 2019
mount.nfs: trying text-based options 'vers=4.2,addr=192.168.0.56,clientaddr=192.168.0.201'
mount.nfs: mount(2): Protocol not supported
mount.nfs: trying text-based options 'vers=4.1,addr=192.168.0.56,clientaddr=192.168.0.201



You need to sort out your Centos config.
 

George Kyriazis

Dabbler
Joined
Sep 3, 2013
Messages
42
Well, I tried from Ubuntu 16.04, and I got a similar result:

On freenas box:
root@nas-backup:~ # more /etc/exports
V4: / -sec=sys
/mnt/vol/s3 -alldirs -maproot="nobody":"nobody"
root@nas-backup:~ #

On ubuntu box:
root@1604:~# mount -vvvv -t nfs 10.123.110.11:/mnt/vol/s3 /mnt/
mount.nfs: timeout set for Tue Mar 19 16:10:04 2019
mount.nfs: trying text-based options 'vers=4,addr=10.123.110.11,clientaddr=10.123.110.40'
mount.nfs: mount(2): Protocol not supported
mount.nfs: trying text-based options 'addr=10.123.110.11'
mount.nfs: prog 100003, trying vers=3, prot=6
mount.nfs: trying 10.123.110.11 prog 100003 vers 3 prot TCP port 2049
mount.nfs: prog 100005, trying vers=3, prot=17
mount.nfs: trying 10.123.110.11 prog 100005 vers 3 prot UDP port 945
root@1604:~# mount -vvvv -t nfs4 -o sec=sys 10.123.110.11:/mnt/vol/s3 /mnt
mount.nfs4: timeout set for Tue Mar 19 16:10:57 2019
mount.nfs4: trying text-based options 'sec=sys,addr=10.123.110.11,clientaddr=10.123.110.40'
mount.nfs4: mount(2): Protocol not supported
mount.nfs4: Protocol not supported
root@1604:~#

First mount (cut-n-paste, effectively, from your mount) mounts as nfsv3, and second mount (forcing nfsv4) fails.

I was reading that if "rpcinfo -p | grep nfs" shows a tcp version 4 on port 2049, then the server support nfsv4, but I am getting:

root@nas-backup:~ # rpcinfo -p | grep nfs
100003 2 tcp 2049 nfs
100003 3 tcp 2049 nfs
root@nas-backup:~ #

So, it looks like only nfs v2 and v3 supported.

I am attaching my NFS settings page. Also please note that I've checked "Serve UDP NFS clients", but the output of rpcinfo -p does not show any UDP ports.

Any thoughts as to what may be wrong?

Thanks!
 

Attachments

  • Screen Shot 2019-03-19 at 4.22.40 PM.png
    Screen Shot 2019-03-19 at 4.22.40 PM.png
    60 KB · Views: 668

KrisBee

Wizard
Joined
Mar 20, 2017
Messages
1,288
The rpcinfo has mislead you, this is mine:

Code:
[chris@freenasB ~]$ rpcinfo -s

   program version(s) netid(s)                         service     owner
    100000  2,3,4     local,udp6,tcp6,udp,tcp          rpcbind     superuser
    100005  3,1       tcp,udp,tcp6,udp6                mountd      superuser
    100003  3,2       tcp                              nfs         superuser
    100024  1         tcp,udp,tcp6,udp6                status      superuser
    100021  4,3,1,0   tcp,udp,tcp6,udp6                nlockmgr    superuser
[chris@freenasB ~]


An Ubuntu guest VM on my freenasB host running FreeNAS-11.1-U7:

Code:
root@ubuntu-vm:/# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.5 LTS
Release:        16.04
Codename:       xenial
root@ubuntu-vm:/# mount -v -t nfs 192.168.0.99:/mnt/Bpool/proxmox-bkups /mnt
mount.nfs: timeout set for Wed Mar 20 09:04:32 2019
mount.nfs: trying text-based options 'vers=4,addr=192.168.0.99,clientaddr=192.168.0.109'
root@ubuntu-vm:/# nfsstat -m                 
/mnt from 192.168.0.99:/mnt/Bpool/proxmox-bkups
Flags: 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.0.109,local_lock=none,
addr=192.168.0.99
root@ubuntu-vm:/# cat /etc/default/nfs-common
# If you do not set values for the NEED_ options, they will be attempted
# autodetected; this should be sufficient for most people. Valid alternatives
# for the NEED_ options are "yes" and "no".
NEED_STATD=yes

# Options for rpc.statd.
#   Should rpc.statd listen on a specific port? This is especially useful
#   when you have a port-based firewall. To use a fixed port, set this
#   this variable to a statd argument like: "--port 4000 --outgoing-port 4001".
#   For more information, see rpc.statd(8) or http://wiki.debian.org/SecuringNFS
STATDOPTS=

NEED_IDMAPD=yes


# Do you want to start the gssd daemon? It is required for Kerberos mounts.
NEED_GSSD=
root@ubuntu-vm:/#cat /etc/idmapd.conf
[General]

Verbosity = 0
Pipefs-Directory = /run/rpc_pipefs
# set your own domain here, if id differs from FQDN minus hostname
# Domain = localdomain
Domain = mynet.com
[Mapping]

Nobody-User = nobody
Nobody-Group = nogroup
root@ubuntu-vm:/# cat /etc/idmapd.conf 
[General]

Verbosity = 0
Pipefs-Directory = /run/rpc_pipefs
# set your own domain here, if id differs from FQDN minus hostname
# Domain = localdomain


You don't need to select "serve UDP clients".

Not necessarily related but I did report a bug in FN11.2 relating to NFSv4/3 selections not resetting correctly : https://redmine.ixsystems.com/issues/66961 this ended up being merged to https://redmine.ixsystems.com/issues/68815 and I cant be sure it was ever resolved in FN11.2-U2.

P.S. If you look at the file /etc/rc.d/nfsd you will see the tunable "vfs.nfsd.server_max_nfsvers" should be set to 4.
 
Last edited:
Top