Linux – NFS client fails with “Protocol not supported” even though the protocol is listed as available

gentoolinuxnfsproxmox

I set up an NFS serve for Proxmox to remotely backup VM images there. For some reason the Proxmox box won't connect to the NFS server. I tested connecting with another the NFS client on a different server and it worked fine. I'm not sure what's wrong because as far as the client's commands say, it does support these connection types (version 3 and 4). I'm not sure what I'm missing here.

IPs replaced with SERVER_IP and CLIENT_IP for simplicity

List of mounts:

root@client:~# showmount SERVER_IP -e
Export list for SERVER_IP:
/export/backups CLIENT_IP/32
/export         CLIENT_IP/32

List of supported protocols:

root@client:~# rpcinfo -p SERVER_IP | egrep "service|nfs"
   program vers proto   port  service
    100003    3   tcp   2049  nfs
    100003    4   tcp   2049  nfs
    100003    3   udp   2049  nfs
    100003    4   udp   2049  nfs

Trying to mount the remote export:

root@client: mkdir -p /nfs/backups
root@client:~# mount SERVER_IP:/export/backups /nfs/backups -vv
mount.nfs: timeout set for Wed Apr 27 17:55:34 2016
mount.nfs: trying text-based options 'vers=4,addr=SERVER_IP,clientaddr=CLIENT_IP'
mount.nfs: mount(2): Protocol not supported
mount.nfs: trying text-based options 'addr=SERVER_IP'
mount.nfs: prog 100003, trying vers=3, prot=6
mount.nfs: trying SERVER_IP prog 100003 vers 3 prot TCP port 2049
mount.nfs: prog 100005, trying vers=3, prot=17
mount.nfs: trying SERVER_IP prog 100005 vers 3 prot UDP port 38873
mount.nfs: mount(2): Protocol not supported
mount.nfs: Protocol not supported

My /etc/exports on the server:

/export CLIENT_IP/32(rw,sync,no_subtree_check,sec=sys,fsid=0)
/export/backups CLIENT_IP/32(rw,sync,no_subtree_check,all_squash,anonuid=1010,anongid=1010)

/export/backups is mount --rbind /home/backups /export/backups. 1010 is the uid and gid for the backups user.

The only edited setting in /etc/conf.d/nfs:

OPTS_RPC_NFSD="8 -N 2 -V 3 -V 4 -V 4.1"

Does anyone have any ideas? Thanks in advance.

Best Answer

Reboot server as per Zacq's comment

Not the solution anyone wants to hear on a production Proxmox server, but it works. There must be an /etc/init.d/[something] restart type fix.

Had exactly the same symptoms as OP.

In addition client was complaining in dmesg

nfsv3: disagrees about version of symbol nlmclnt_proc
nfsv3: disagrees about version of symbol nfs_alloc_client
nfsv3: disagrees about version of symbol nfs_access_zap_cache
nfsv3: disagrees about version of symbol nfs_submount
nfsv3: disagrees about version of symbol nfs_create_server
nfsv3: disagrees about version of symbol nfs_post_op_update_in$
nfsv3: disagrees about version of symbol nfs_mkdir
nfsv3: disagrees about version of symbol nfs_get_client
nfsv3: disagrees about version of symbol nfs_file_operations
nfsv3: disagrees about version of symbol nfs_lookup
nfsv3: disagrees about version of symbol nfs_getattr
nfsv3: disagrees about version of symbol register_nfs_version
nfsv3: disagrees about version of symbol nfs_setattr
nfsv3: disagrees about version of symbol unregister_nfs_version
nfsv3: disagrees about version of symbol nfs_sops
nfsv3: disagrees about version of symbol nfs_link
nfsv3: disagrees about version of symbol nfs_try_mount
nfsv3: disagrees about version of symbol nfs_close_context
nfsv3: disagrees about version of symbol nfs_symlink
nfsv3: disagrees about version of symbol nfs_clone_server
nfsv3: disagrees about version of symbol nlmclnt_proc
nfsv3: Unknown symbol nfs_writeback_update_inode (err -22)
nfsv3: Unknown symbol nfs_dentry_operations (err -22)