Closed gisburn closed 5 months ago
Is it possible to modify the libnfs-tools so they try NFSv4 first, or have an env var to set this ?
BTW specifying version=4 does not work:
$ nfs-ls nfs://derfwnb4966_ipv4//bigdisk
Failed to mount nfs share : mount/mnt call failed with "Server responded: Program version mismatch"
$ nfs-ls "nfs://derfwnb4966_ipv4//bigdisk?version=4"
Failed to mount nfs share : mount/mnt call failed with "Server responded: Program version mismatch"
$ nfs-ls "nfs://derfwnb4966_ipv4//bigdisk?version=4&nfsport=2049"
Failed to mount nfs share : mount/mnt call failed with "Server responded: Program version mismatch"
mount/mnt means it still tries to connect using nfsv3 and not v4. Mount protocol is only used with v3.
I have verified his works locally using: ./utils/nfs-ls nfs://10.10.10.11/data/SNAP-4/\?version=4
and in wireshark I see it connects directly to the default port 2049 and uses the nfsv4 protocol.
Try this with current master of libnfs.
I have tested this and it works on current master. I have also added a fall-back to try v4 mounts if v3 failed.
Unless you specify a specific version. In that case only that version will be tried and no fall-back will be attempted.
nfs-ls does not work with NFSv4-only server
Example:
NFS server is Debian 11 with Linux 6.6 LTS kernel, NFSv2 support is not build, and NFSv3 support has been disabled with "--no-nfs-version 3" per security policy requirements (e.g. only NFSv4.x is allowed):