Use this when exporting NAS directories to Linux and Unix clients over NFS.
NFS · NAS
NFS on a NAS exports directories to Unix and Linux clients. Restrict exports by host or subnet, choose NFSv3 or NFSv4 consistently, and align user IDs or use Kerberos so permissions work as intended.
1. NAS NFS service exports directories to UNIX clients.
2. Prefer NFSv4.1+.
3. Restrict exports by client.
4. Kerberos for security.
5. Hard mounts.
client → NFS → NAS export
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Common mistakes Narrow the fault
- NFSv3 with AUTH_SYS on untrusted networks.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
- Restrict exports by host or subnet.
- Root squash maps root to nobody.
- UID/GID must match or use Kerberos.
showmount -e <nas>— exportsnfsstat -m— client optionsrpcinfo -p <nas>— services
ReferenceHow it works1 section · depth on demand
Reference
| Option | Meaning |
|---|---|
hard | Retry forever (safe for data) |
soft | Fail after retries (risk of data loss) |
nconnect=N | Several TCP connections (Linux 5.3+) |
vers=4.1 | Protocol version |
_netdev | Wait for network at boot |
ReferenceImportant terms & boundaries3 sections · depth on demand
In depth
Running an NFS export: syntax, durability and applying changes
exports(5) describes the format. Each line has a path, then client specifications, each with an optional parenthesised option list, with no space before the parenthesis.
# /etc/exports
/srv/vmstore 10.0.40.11(rw,sync,no_root_squash) 10.0.40.12(rw,sync,no_root_squash)
/srv/home 10.0.20.0/24(rw,sync,root_squash)
/srv/iso *(ro,all_squash)
# exportfs -ra
# exportfs -v
/srv/vmstore 10.0.40.11(sync,wdelay,hide,no_subtree_check,sec=sys,rw,secure,no_root_squash,no_all_squash)
The space before the parenthesis matters
/srv/data host(rw) gives host read-write. /srv/data host (rw) gives host the defaults and gives everyone read-write.
Durability: sync versus async
| Option | Behaviour (exports(5)) |
|---|---|
sync (default) | Reply only after data is on stable storage |
async | Reply earlier; a server crash can lose or corrupt data |
Keep sync for VM disks, databases and anything where clients assume committed writes are safe.
Other defaults worth knowing
| Option | Default | Effect |
|---|---|---|
secure | On | Requests (other than GSS) must come from ports below 1024 |
no_subtree_check | On | Better reliability; subtree_check adds a check for subdirectory exports |
sec=sys | On | Trusts client UIDs; use krb5* for authentication |
Server-side checks
| Check | Command |
|---|---|
| Active exports | exportfs -v |
| NFS server running | systemctl status nfs-server |
| Versions offered | cat /proc/fs/nfsd/versions |
| Clients connected (NFSv4) | ls /proc/fs/nfsd/clients/ |
| Firewall | NFSv4: TCP 2049; NFSv3 also rpcbind and mountd |
Documented example, not captured output.
How it works
The NAS exports a directory over NFS; clients mount it and see a normal filesystem. Access is controlled by export rules (client IPs, root squash) and file permissions, with NFSv4 adding Kerberos and ID mapping.
Mount example
mount -t nfs4 -o vers=4.1,hard,timeo=600 nas01:/export/data /mnt/data
# /etc/fstab
nas01:/export/data /mnt/data nfs4 _netdev,vers=4.1,hard 0 0
Documented example, not captured output.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in NAS → NFS. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://www.snia.org/education/what-is-network-attached-storage · confidence 94%