NFS allows you to share local disk over your local network. NFS originally supported by Linux, however, in recent releases of Windows supports it. Sometimes, you might face the error message mount.nfs: mount system call failed or check lease failed on NFSv4 server when you mount shared directory from NFS server. hence, failing to mount your directory.
Investigating the issue
During investigating any issue you cloud obtain knowledge about many things more than getting a direct solution from someone. hence, I suggest continuing reading.
Check connectivity to the server.
The first thing is to confirm that you don’t have any connectivity issues to the server. because sometimes network guys do unintentionally.
you can check nfs status by executing rpcinfo command.
[root@MFVMDML-UNOCONV01 var]# rpcinfo -p 172.16.10.26 program vers proto port service 100000 2 tcp 111 portmapper 100000 2 udp 111 portmapper 100024 1 udp 58355 status 100024 1 tcp 34069 status 100003 2 tcp 2049 nfs 100227 2 tcp 2049 nfs_acl 100021 1 tcp 55381 nlockmgr 100005 1 udp 56628 mountd 100005 1 tcp 58276 mountd
The above results reported by the server saying I’m OK, however, it’s a misleading report. therefore, further investigation is required.
Check client OS logs.
Further scrutiny is required, hence, we will dive into OS logs and check kernel ring buffer messages.
Our objective to search for our famous error message “mount.nfs: mount system call failed” or error related to NFS. So, execute dmesg command as shown below.
[root@MFVMDML-UNOCONV01 ~]#dmesg [1981456.923442] nfs: server 172.16.10.26 not responding, timed out [1981456.923533] nfs: server 172.16.10.26 not responding, still trying [1981637.403831] nfs: server 172.16.10.26 not responding, timed out [2118031.199289] NFS: state manager: check lease failed on NFSv4 server 172.16.10.26 with error 13 [2118036.225762] NFS: state manager: check lease failed on NFSv4 server 172.16.10.26 with error 13
Similar results might show that the NFS server is not responding. So that leads to focus our efforts on the server
dmesg is used to examine or control the kernel ring buffer.
Solving the problem
All NFS servers maintain a table of local directories that are accessible to NFS clients. Yet, restarting NFS services solve nothing. therefore, We need to force NFS to re-check its shares table and update it with the current configurations. luckily NFS tools come with one called exportfs.
This tool maintains table of exported NFS file systems as described in man pages.
login into NFS server with superuser privileges. then, execute exportfs command with parameter -a to rebuild all exports tables.
root@mfvmmdls01:/var/www# exportfs -a