Error Codes Wiki

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

Errornetwork

About NFS Mount Errors

Fix NFS mount errors including 'access denied by server', stale NFS file handle, mount timeout, and NFS version compatibility issues on Linux. This guide covers everything you need to know about this topic, including common causes, step-by-step solutions, and answers to frequently asked questions.

Here are the key things to understand: 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. Understanding these fundamentals will help you diagnose and resolve this issue more effectively.

The most common reasons this occurs include: 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. Identifying the root cause is the first step toward finding the right solution.

To resolve this, follow these recommended steps: Check server exports: showmount -e server-ip from the client. Mount NFSv4: mount -t nfs4 server:/share /mnt/nfs. Fix stale handle: unmount and remount: umount -f /mnt/nfs && mount server:/share /mnt/nfs. Check server firewall: ensure TCP 2049 is open (NFSv4 only needs this port). Fix permissions: use no_root_squash in /etc/exports (caution: security risk) or fix UID mapping. After editing /etc/exports: exportfs -ra to apply changes without restarting NFS. If these steps do not resolve the issue, consider consulting additional resources or a qualified professional.

This article is part of our Linux Error Codes collection on Error Codes Wiki. We provide comprehensive, up-to-date information to help you find solutions quickly.

Quick Answer

What is a stale NFS file handle?

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.

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.