LinuxXVIII · Enterprise StorageNFS
NFS client - mounting and operating network filesystems
What you'll learn
- Mount an NFS export with appropriate options
- Use _netdev and nofail for safe boot behavior
- Troubleshoot common NFS mount failures
- Configure NFS for production workloads
Prerequisites
Verified against Ubuntu 24.04 LTS · Debian 12 (Bookworm) · RHEL 9.x · Rocky Linux 9.x · AlmaLinux 9.x · Linux kernel 6.1 LTS / 6.6 LTS · systemd 255+ · OpenSSH 8.7p1 (RHEL 9) / 9.6p1 (Ubuntu 24.04) · nftables 1.0.x · chrony 4.x · Pacemaker 2.1.x · Corosync 3.1.x · 2026-08-09
NFS is the standard Linux network filesystem. The NFS client mounts a remote export and presents it as a local directory. Understanding the mount options, the network dependencies, and the failure modes is essential for production.
Discovering exports
$ showmount -e nfs-server.example.comExport list for nfs-server.example.com:
/export/data 10.0.0.0/24
/export/home 10.0.0.0/24Mounting an NFS export
$ mount -t nfs -o vers=4.1,proto=tcp,rsize=1048576,wsize=1048576,hard,timeo=600 nfs-server:/export/data /mnt/nfsfstab entry
$ grep nfs /etc/fstabnfs-server:/export/data /mnt/nfs nfs4 _netdev,nofail,hard,timeo=600,retrans=3 0 0NFS mount options
| Option | Effect | When to use |
|---|---|---|
vers=4.1 (or vers=4.2) | NFS version | Required for modern kernels |
proto=tcp | TCP transport | Required for NFSv4 |
rsize=N / wsize=N | Read/write block size | Match to server (1 MB typical) |
hard | Retry indefinitely on failure | Production: avoid silent data loss |
soft | Return error after timeout | Avoid in production |
timeo=N | Timeout in deciseconds (60 = 6 sec) | Default 60, increase to 600 for slow links |
retrans=N | Number of retries | Default 3, increase to 6 for unreliable links |
rsize=1048576,wsize=1048576 | 1 MB block size | Match to server MTU |
lookupcache=pos or lookupcache=none | Caching mode | pos for POSIX; none for changing data |
noacl | Disable ACL processing | When ACLs are not needed |
sec=sys / sec=krb5 | Security mode | sys for local; krb5 for Kerberos |
Troubleshooting NFS mount failures
$ mount -v -t nfs nfs-server:/export/data /mnt/nfs 2>&1 | head -10mount.nfs: timeout set for Sat Jan 15 10:00:00 2026
mount.nfs: trying text-based options 'vers=4.1,addr=10.0.0.10,clientaddr=10.0.0.20'
mount.nfs: mount(2): Connection refused| Symptom | Likely cause | Fix |
|---|---|---|
| Connection refused | NFS service not running, firewall | systemctl status nfs-server and check firewall |
| Connection timed out | Network issue, no route | ping nfs-server, check routing |
| Permission denied | Export does not allow your client IP | Check /etc/exports on server, add your client IP |
| Stale file handle | NFS server lost the export, client has open files | umount /mnt/nfs and remount |
| No such file or directory | Export path is wrong on server | Check /etc/exports on server |
Knowledge check
Knowledge check · 3 questions
Q1. What does the hard mount option in NFS mean?
Q2. For production NFS mounts, _netdev is mandatory.
Q3. Which of the following are correct NFS practices? Select all that apply.
Passing score: 75%. Answers are checked in this browser.