Which version of NFS is my NFS server using?

I’m mounting a NFS filesystem on my machine. How do I figure out what version of the NFS protocol the server uses? I don’t have access to the NFS server machine, but I do have root on my client machine.

Is there anything I can run on my client machine to identify what version of the NFS protocol is being used by the server, or what versions it supports?

I wasn’t able to find any useful information in /var/log/messages or kernel debugging output (dmesg).

I have tried running nfsstat, but I’m not sure if it is giving me any useful information. However, when I run nfsstat -s to request information about the server, I don’t see anything useful:

# nfsstat -s
Server rpc stats:
calls      badcalls   badfmt     badauth    badclnt
0          0          0          0          0       

When I run nfsstat -c to request information about the client, I do see some information about Client nfs v3, but I’m not sure how to interpret this. Does this tell me anything about the protocol being used between my client machine and the NFS server? Does it mean I am currently using v3 of the NFS protocol? Does it tell me anything about what versions of the NFS protocol the server supports, e.g., NFS v4?

Asked By: D.W.

||

Depending your OS and version there may be different ways to check it.

nfsstat:

# nfsstat -m
/mnt/share from 10.0.0.1:/mnt/share
Flags:  rw,relatime,vers=3,rsize=524288,wsize=524288,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=10.0.0.1,mountvers=3,mountport=30924,mountproto=udp,local_lock=none,addr=10.0.0.1

But you can for sure

# grep nfs /proc/mounts
10.0.0.1:/mnt/share /mnt/share nfs rw,relatime,vers=3,rsize=524288,wsize=524288,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=10.0.0.1,mountvers=3,mountport=30924,mountproto=udp,local_lock=none,addr=10.0.0.1

which is obviously the same output.

It shows vers=3 on server, and mountvers=3.

Answered By: user55518

The nfsstat -c program will show you the NFS version actually being used.

If you run rpcinfo -p {server} you will see all the versions of all the RPC programs that the server supports. On my system I get this output:

$ rpcinfo -p localhost
   program vers proto   port
    100000    2   tcp    111  portmapper
    100000    2   udp    111  portmapper
    ...
    100003    2   tcp   2049  nfs
    100003    3   tcp   2049  nfs
    100003    4   tcp   2049  nfs
    100003    2   udp   2049  nfs
    100003    3   udp   2049  nfs
    100003    4   udp   2049  nfs
    ...

This shows me that my NFS server (localhost in this example) offers versions 2, 3, and 4 of the NFS protocol all over UDP and TCP.

Answered By: roaima

One can open /etc/nfsmount.conf and get the information about default version and supported version.

Answered By: krishna
Categories: Answers Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.