Skip to content

Linux NFS Mount — Server Not Responding Fix

DodaTech Updated 2026-06-24 3 min read

In this tutorial, you'll learn about Linux NFS Mount. We cover key concepts, practical examples, and best practices.

NFS mounts fail with "mount.nfs: Connection timed out", "mount.nfs: Server not responding", or the mount hangs indefinitely. These occur when the NFS server is unreachable, firewall blocks the ports, the export is misconfigured, or the NFS service is not running.

The Problem

sudo mount -t nfs server:/export /mnt

Error:

mount.nfs: Connection timed out

Or the command hangs with no output. After forcing a disconnect:

mount.nfs: Connection reset by peer

Wrong Approach

# WRONG — randomly choosing NFS versions
sudo mount -t nfs4 server:/export /mnt
sudo mount -o vers=4 server:/export /mnt

Right Approach

# Test connectivity first
rpcinfo -p server

Expected output:

   program vers proto   port  service
    100003    3   tcp   2049  nfs
    100003    3   udp   2049  nfs
    100005    1   tcp    892  mountd
    100005    1   udp    892  mountd

Then mount with explicit options:

sudo mount -t nfs -o vers=4.2,noatime,hard,intr server:/export /mnt

Step-by-Step Fix

Step 1: Check NFS server availability

rpcinfo -p server
showmount -e server

Step 2: Check firewall rules on both sides

# On server — ensure NFS ports are open
sudo firewall-cmd --add-service=nfs --permanent
sudo firewall-cmd --reload

# On client
sudo firewall-cmd --list-all

Step 3: Verify the export exists

showmount -e nfs-server

Expected:

Export list for nfs-server:
/export    client-ip

Step 4: Check the NFS server configuration

# On the NFS server
cat /etc/exports

Expected:

/export    client-ip(rw,sync,no_subtree_check)

Step 5: Restart NFS services

# On the server
sudo systemctl restart nfs-server
sudo systemctl restart nfs-mountd
sudo exportfs -r

Step 6: Mount with correct options

sudo mount -t nfs -o vers=4.2,hard,intr,timeo=30,retrans=3 server:/export /mnt

Step 7: Auto-mount with fstab

server:/export /mnt nfs vers=4.2,hard,intr,timeo=30,retrans=3,_netdev 0 0

Prevention Tips

  • Keep NFS server and client versions compatible
  • Open the following ports in the firewall: 2049 (NFS), 111 (portmapper), 892 (mountd)
  • Use NFSv4+ for better performance and simpler firewall rules
  • Set timeo=30 and retrans=3 to avoid long timeouts
  • Test mounts with mount -v for verbose output

Common Mistakes with nfs mount

  1. Forgetting that lazy evaluation defers computation until the value is forced, causing space leaks with unevaluated thunks
  2. Using return to exit a function early instead of wrapping a pure value in the monad
  3. Mixing let bindings with <- bindings in do notation, producing type errors

These mistakes appear frequently in real-world LINUX code. DodaTech's contributors have identified these patterns through analysis of open-source projects and production systems.

Practice Exercise

Write a pure function that safely divides two integers using Maybe, then test it with edge cases like division by zero and negative numbers.

This exercise reinforces the concepts covered in this guide. Try implementing it before checking online solutions.

FAQ

### Why does NFS mount hang indefinitely?

NFS mounts hang when the server is unreachable and the default timeout is too long. Add timeo=30 (30-second timeout) and intr (interruptible) to interrupt the mount if it hangs. Check network connectivity and firewall between the systems.

What ports does NFS use?

NFSv3 requires port 111 (portmapper), 2049 (nfsd), and dynamic ports for mountd/nlockmgr. NFSv4 uses only port 2049, making firewall configuration simpler. Use NFSv4 if possible for better security and fewer firewall rules.

How do I debug NFS performance issues?

Use nfsstat to check NFS statistics, mountstats for per-mount details, and /proc/self/mountstats for detailed I/O metrics. Slow NFS is often caused by small rsize/wsize values, network latency, or overloaded NFS servers.

Built by the developers of DodaTech

Doda Browser, DodaZIP & Durga Antivirus Pro