Error Codes Wiki

NFS Mount Errors — Permission Denied, Stale Handle, and Connection Issues

Errornetwork

Overview

Fix NFS mount errors including 'access denied by server', stale NFS file handle, mount timeout, and NFS version compatibility issues on Linux.

Key Details

  • NFS (Network File System) allows sharing directories between Linux systems over the network
  • NFS v4 uses TCP port 2049 only; NFS v3 requires portmapper (port 111) and additional random ports
  • Stale NFS file handle occurs when the server-side file or directory was deleted or the export changed
  • UIDs and GIDs must match between client and server for correct file ownership (or use id mapping)
  • NFS is sensitive to network reliability — high latency or packet loss causes timeouts and hangs

Common Causes

  • NFS export configuration (/etc/exports) not allowing the client's IP address
  • Firewall blocking NFS ports (TCP/UDP 2049 for NFSv4, plus 111 and others for NFSv3)
  • UID/GID mismatch between client and server causing permission denied on files
  • Server-side export path changed or the exported directory deleted
  • Network interruption causing stale NFS file handles

Steps

  1. 1Check server exports: showmount -e server-ip from the client
  2. 2Mount NFSv4: mount -t nfs4 server:/share /mnt/nfs
  3. 3Fix stale handle: unmount and remount: umount -f /mnt/nfs && mount server:/share /mnt/nfs
  4. 4Check server firewall: ensure TCP 2049 is open (NFSv4 only needs this port)
  5. 5Fix permissions: use no_root_squash in /etc/exports (caution: security risk) or fix UID mapping
  6. 6After editing /etc/exports: exportfs -ra to apply changes without restarting NFS

Tags

nfsmountnetwork-filesystemstale-handlefile-sharing

Related Items

More in Network

Frequently Asked Questions

The NFS client is referencing a file or directory that no longer exists on the server (deleted, renamed, or export changed). The fix is to unmount and remount the NFS share.