RHEL 7 – Use NFS Version 3

linuxnfsnfs4redhat

I tested using nfs version 3 on my lab system, and it works fine.

[root@server2 ~]# tail -1 /etc/mtab

server1:/nfs /nfs nfs rw,relatime,vers=3,rsize=262144,wsize=262144,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=192.168.150.134,mountvers=3,mountport=20048,mountproto=udp,local_lock=none,addr=192.168.150.134 0 0

[root@server2 ~]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.4 (Maipo)
[root@server2 ~]#

However. when I do the same thing on Azure, it fails. I followed this guide

Link to vers 3 nfs

But when I mount it using version 3, it gives below error

mount -vv  -t nfs -o vers=3 server1:/appl /wbr

mount.nfs: timeout set for Thu Aug  1 02:38:02 2019
mount.nfs: trying text-based options 'vers=3,addr=10.200.254.8'
mount.nfs: prog 100003, trying vers=3, prot=6
mount.nfs: trying 10.200.254.8 prog 100003 vers 3 prot TCP port 2049
mount.nfs: prog 100005, trying vers=3, prot=17
mount.nfs: trying 10.200.254.8 prog 100005 vers 3 prot UDP port 20048
mount.nfs: portmap query retrying: RPC: Timed out

Version 4 works just fine, but version 3 does not!

Any ideas?

Best Answer

The vendor provides NFSv3 support in RHEL7 (see Introduction to NFS).

Please do the following checks:

1) Ensure NFSv3 support is enabled in the /etc/sysconfig/nfs file:

NFS3_SERVER_SUPPORT="yes"

To prevent clients from using NFSv4, add the setting

RPCNFSDARGS= -N 4

2) Check if NFS daemons are running on the NFS server:

# service nfs status
# service portmap status

3) Check if your NFS server in Azure is available from the client system via NFS network ports:

  • port 111 (TCP and UDP);
  • port 2049 (TCP and UDP)

with any tool you prefer, e.g.:

# telnet nfs_server_ip_addr 2049
# nmap -sU -p 111,2049 nfs_server_ip_addr
# nmap -sT -p 111,2049 nfs_server_ip_addr

4) Check if existing mounts are visible from the client system:

# showmount -e nfs_server_name