Nfs – Timeout client-side during NFS mount

mountnfstimeout

Some context:

Two RHEL 7 hosts.

The first one is the NFS server, and exports two directories in the very same fashion:

> cat /etc/exports
/first/dir otherhost(rw,sync,no_subtree_check,no_root_squash)
/second/dir otherhost(rw,sync,no_subtree_check,no_root_squash)

The first directory /first/dir will be a small one. While the second one will be quite large as it will grow over time, its LVM volume size is 300Go, but currently the FS is empty.

The second host otherhost is the NFS client. The two FS are mounted in fstab this way:

> grep nfs /etc/fstab
nfsserver:/first/dir /here nfs nfsvers=4,minorversion=1,_netdev 0 0
nfsserver:/second/dir /somewhere nfs nfsvers=4,minorversion=1,_netdev 0 0

The 2049 TCP port is used and exposed on the server side. After analysis no other network connection is logged in the firewall (not even 2049 UDP). Everything seems to be OK on the network side of things.

What we see:

  • if we mount the two directories in /etc/fstab (using mount -a for example) in the order "first" and then "second", the second mount fails with a timeout
  • if we mount the two directories in reverse order ("second", then "first", either by inverting them in /etc/fstab or manually), then the two mounts are OK…

Obviously that's not normal behaviour.

I'm here to ask if someone ever encountered such a crazy NFS behaviour. And if not, do you have any advice on how to analyze this issue? Thanks a lot for your help.

Best Answer

I would investigate the network a bit further. Do a tcpdump targeting the NFS server (filter using port & IP/name).

Otherwise, you can try playing around with the bg & timeo options, see if that gets you anywhere.