requested NFS version or transport protocol is not supported CentOS

Recently we experienced this issue with NFS mounting to our backup server. At boot, and when we ran mount -a, the NFS client gave us a generic error:

Mounting network file systems ...mount.nfs: requested NFS version or transport protocol is not supported

The solution was to reboot the NFS server. Below is why that worked, and how to find and fix the cause without a reboot next time.

What the error means

The client asked the server for a particular NFS version over a particular transport (TCP or UDP), and nothing on the server answered for that combination. That covers more than one situation:

  • The NFS server daemons (nfsd) or rpcbind are not running, or nfsd is not registered with rpcbind. A reboot restarts both and re-registers everything, which is most likely why rebooting fixed it for us.
  • The client asks for a version the server has turned off, for example vers=3 on a server that only serves NFSv4, or NFSv4 on an old server that only does v3.
  • The client asks for UDP (proto=udp) and the server only serves TCP. NFSv4 always uses TCP, and newer servers often turn UDP off.
  • A firewall drops the traffic to port 2049 (and, for NFSv3, ports 111 and the mountd port).

Prerequisites

  • Root on both the NFS client and the NFS server.
  • The server name or IP address and the export path (here, the backup server’s export).

1. Check what the server offers

From the client, ask the server’s rpcbind which NFS versions and transports are registered:

rpcinfo -p backupserver
showmount -e backupserver

In rpcinfo look for nfs lines with version 3 and/or 4 on tcp. No nfs lines at all, or a “connection refused” or timeout, points at the server. showmount only works for NFSv3 (it talks to mountd), so an error there on a v4-only server is normal.

On the server, see which versions nfsd has turned on:

cat /proc/fs/nfsd/versions

Output such as -2 +3 +4 +4.1 +4.2 means v3 and v4.x are on.

2. Restart the NFS services on the server

Instead of a full reboot, restart rpcbind and NFS. On CentOS 6:

service rpcbind restart
service nfs restart

On CentOS 7 and RHEL, AlmaLinux and Rocky Linux 8 to 10:

systemctl restart rpcbind
systemctl restart nfs-server
exportfs -v

exportfs -v confirms the export is active and shows its options.

3. Ask for a version the server supports

Test by hand with an explicit version, then put the one that works into /etc/fstab:

mount -t nfs -o vers=3 backupserver:/backup /mnt/backup
mount -t nfs -o vers=4.2 backupserver:/backup /mnt/backup

If the fstab entry contains proto=udp or udp, change it to TCP.

Verify

mount | grep nfs
nfsstat -m
df -h /mnt/backup

nfsstat -m shows each NFS mount with the version (vers=) and protocol (proto=) actually in use.

Troubleshooting

  • Firewall: on a firewalld server, NFSv4 only needs firewall-cmd --permanent --add-service=nfs. NFSv3 also needs rpc-bind and mountd. Run firewall-cmd --reload afterwards.
  • Versions turned off on purpose: on RHEL, AlmaLinux and Rocky 8 and later, the NFS server versions and UDP support are set in the [nfsd] section of /etc/nfs.conf (entries such as vers3=y and udp=n). Restart nfs-server after editing it.
  • A different error: for input/output error see input/output error from NFS client on CentOS, and for mounts that hang see Troubleshoot Stuck and Hung NFS Mounts on AlmaLinux 10.

Related guides: input/output error from NFS client on CentOS | Mount NFS Share on CentOS 6

Leave a Reply

Your email address will not be published. Required fields are marked *