NFS Mount Error
Linux Linux
Severity: ModerateWhat Does This Error Mean?
An NFS mount error occurs when Linux cannot mount a network file system share from another computer. NFS (Network File System) lets you access files on a remote server as if they were on your local drive. Common error messages include 'mount.nfs: access denied by server,' 'No such file or directory,' and 'Connection refused.' These errors usually mean the NFS server is not running, the client's IP is not allowed, or the network path is wrong.
Affected Models
- Ubuntu
- Debian
- Fedora
- CentOS
- Arch Linux
- openSUSE
- RHEL
Common Causes
- The NFS server is not running or the NFS service has crashed on the remote machine
- The client's IP address is not listed in the server's /etc/exports configuration
- A firewall on the server or network is blocking NFS ports (2049, 111)
- The mount path on the server does not exist or the export path is typed incorrectly
- NFS client utilities are not installed on the local machine
How to Fix It
-
Verify the NFS server is running. SSH into or log into the server and check: sudo systemctl status nfs-server (or nfs-kernel-server on Debian/Ubuntu). Start it if stopped: sudo systemctl start nfs-server
An NFS client cannot mount anything if the server is not running. Always verify server status first.
-
Check what the server is exporting. On the client, type: showmount -e [server-ip] — this lists all exports the server is sharing. Confirm your mount path matches exactly.
If showmount fails with 'connection refused,' the rpcbind service on the server may not be running. Check it with: sudo systemctl status rpcbind
-
Verify the client IP is allowed in /etc/exports on the server. On the server, type: cat /etc/exports — each export line specifies which hosts can mount it. Add your client IP if missing: /shared/path [client-ip](rw,sync,no_subtree_check)
After editing /etc/exports, run: sudo exportfs -ra on the server to reload the export list.
-
Install NFS client utilities if missing. On Ubuntu/Debian: sudo apt install nfs-common — on Fedora/RHEL: sudo dnf install nfs-utils — then retry the mount.
The nfs-common or nfs-utils package provides the mount.nfs command and related tools. Without it, NFS mounts cannot be attempted.
-
Test the mount manually. Type: sudo mount -t nfs [server-ip]:/exported/path /local/mountpoint — if it succeeds, add the entry to /etc/fstab for automatic mounting at boot.
Testing manually first shows errors clearly. Once manual mounting works, fstab automation is straightforward.
When to Call a Professional
NFS configuration is a standard system administration task. If you are setting up NFS for the first time in a business environment, a system administrator can configure it securely. Insecure NFS configurations are a known security risk on public networks.
Frequently Asked Questions
What ports does NFS use?
NFS version 4 uses only port 2049 (TCP and UDP). NFS version 3 also uses port 111 (rpcbind) and several dynamic ports. If you have a firewall, ensure port 2049 is open. For NFS version 4 only, you can simplify firewall rules significantly compared to NFS version 3.
NFS worked yesterday but stopped today. What could have changed?
The most common causes of sudden NFS failures are: the server was restarted and NFS was not set to start automatically (fix: sudo systemctl enable nfs-server), a firewall rule change blocked port 2049, or the server's IP address changed (update /etc/fstab on the client with the new IP). Check the server first — most sudden failures originate there.
Is NFS secure to use over the internet?
Standard NFS is not designed for use over the internet — it was built for trusted local networks. Exposing NFS ports to the internet is a serious security risk. For secure remote file access, use SFTP or SSHFS instead. If you must use NFS over an untrusted network, tunnel it over a VPN.