3

Running RHEL 7.9 and trying to do nfs between a few servers on a LAN. I am always getting nfs v3 as the mount. Is there a way to get the latest version of nfs to happen, which is 4.2 I think according to /etc/nfs.conf ?

On one server on a different LAN I am seeing

mount | grep bkup

bkupserver:/bkup on /bkup type nfs4 (rw,nosuid,noexec,relatime,vers=4.1,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=192.168.1.2,local_lock=none,addr=192.168.1.1)

But I do not know why it is vers=4.1 there and not 4.2.

But my real problem is my other servers it is always saying vers=3 and I do not know why.

Only thing I noticed different between my servers is the nfsv4 working one has /etc/exports as /bkup *(rw,no_root_squash) versus my nfsv3 servers having /etc/exportsas/bkup *(rw, async, no_root_squash)`.

Will the exports options inherently cause or prevent an nfs version to happen?

Below is my '/etc/nfs.conf' for reference where I'm stuck with getting nfs v3 all the time. And the /etc/sysconfig/nfs I have edited to match the port numbers only as shown below. And just noticed on my server that is doing vers=4.1 that its '/etc/nfs.conf' is untouched and I only edited /etc/sysconfig/nfs to declare port numbers so I can open then in firewalld.

# This is a general configuration for the
# NFS daemons and tools; this is /etc/nfs.conf in RHEL 7.9
#
#[general]
# pipefs-directory=/var/lib/nfs/rpc_pipefs
#
#[exportfs]
# debug=0
#
#[gssd]
# verbosity=0
# rpc-verbosity=0
# use-memcache=0
# use-machine-creds=1
# avoid-dns=1
# limit-to-legacy-enctypes=0
# context-timeout=0
# rpc-timeout=5
# keytab-file=/etc/krb5.keytab
# cred-cache-directory=
# preferred-realm=
#
[lockd]
port=4001
udp-port=4001
#
#[mountd]
# debug=0
# manage-gids=n
# descriptors=0
port=4002
threads=8
# reverse-lookup=n
# state-directory-path=/var/lib/nfs
# ha-callout=
#
#[nfsdcltrack]
# debug=0
# storagedir=/var/lib/nfs/nfsdcltrack
#
[nfsd]
# debug=0
threads=8
# host=
port=4003
# grace-time=90
# lease-time=90
udp=y
tcp=y
# vers2=n
vers3=y
vers4=y
vers4.0=y
vers4.1=y
vers4.2=y
rdma=y
#
#[statd]
# debug=0
port=4004
outgoing-port=4005
# name=
# state-directory-path=/var/lib/nfs/statd
# ha-callout=
# no-notify=0
#
[sm-notify]
# debug=0
# force=0
# retry-time=900
outgoing-port=4006
# outgoing-addr=
# lift-grace=y
2
  • apparently /etc/sysconfig/nfs edit RPCNFSDARGS="-V 4.2" per access.redhat.com/solutions/2325171
    – ron
    Feb 1, 2022 at 21:39
  • that redhat instruction doesn't work. cat /proc/fs/nfsd/versions shows 4.2 is enabled but I always get 4.1; trying to force /etc/nfs.conf to do only 4.2 results in an nfs protocol not supported
    – ron
    Feb 1, 2022 at 22:18

1 Answer 1

0
  • If the systems that are connecting to the CentOS 7.9 NFS server are older then CentOS 7.0, they will only be able to connect using NFS 4.1 or NFS 3.

  • To force the system to try NFS4 and version 4.2 use these options in your mount command:

#mount -t nfs4 -o vers=4.2,rw,no_root_squash bkupserver:/bkup /bkup
  • Ensure you have opened the correct ports on your firewall for NFS V4
#firewall-cmd --permanent --add-service=nfs
#filewall-cmd --permanent --add-service=rpc-bind
#firewall-cmd --reload

For completeness, as noted above, you will need to ensure version v4.2 is enabled.

See Reference: https://access.redhat.com/solutions/2325171

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .