Problem:
When I was trying to mount a folder shared from NFS Server to the NFS Client machine then I was getting the below error:
[root@NFSClient /]# mount 10.20.2.22:/test /test
mount: mount to NFS server '10.20.2.22' failed: timed out (retrying).
mount: mount to NFS server '10.20.2.22' failed: timed out (retrying).
Configuration on NFS Server:
- Folder /test exported on the client machine with appropriate options.
[root@NFSServer ~]# vi /etc/exports /test NFSClient(rw,sync,no_root_squash)
- showmount also shows that /test exported to the NFSClient but when I was trying to mount this was being failed with request time out error.
[root@NFSServer ~]# exportfs -a [root@NFSServer ~]# showmount -e Export list for NFSServer: /test NFSClient
Reason:
I found that firewall (iptables) was enabled on the NFSServer machine and that was blocking the request so either turn off the firewall or allow the required ports for NFS to the firewall.
Solution:
- Turn off the firewall/iptables or allow the required ports.
- Allow the request for the NFS ports 2049 and 111. Make the entries in /etc/sysconfig/iptables and restart the iptables service.
[root@TestServer ~]# vi /etc/sysconfig/iptables . . . -A INPUT -p udp -m state --state NEW -m udp --dport 2049 -j ACCEPT -A INPUT -p udp -m state --state NEW -m udp --dport 111 -j ACCEPT . . .
After updating the /etc/sysconfig/iptables file restart the iptables service to enable the policies on the internal firewall.
[root@TestServer ~]# service iptables restart iptables: Setting chains to policy ACCEPT: filter [ OK ] iptables: Flushing firewall rules: [ OK ] iptables: Unloading modules: [ OK ] iptables: Applying firewall rules: [ OK ]
- Try to mount and you will be able to successfully mount.
Last Updated: August 18, 2020
Related Post
- Umount NFS Volume showing Stale file handle error in RHEL Systems
- Cannot mount NFS share in RHEL 7: wrong fs type, bad option, bad superblock
- mount: mount to NFS server xx.x.xx failed: timed out (giving up)
- NFS mount points unreachable and df hangs
- mount: mount to NFS server xx.xx.x.xx failed: timed out (retrying)
- mount: mount to NFS server xx.x.xx failed: timed out (retrying)