Use it for file sharing between Linux/Unix systems, such as home directories or shared data.
NFS
NFS (Network File System) shares directories from a Linux server to clients. NFSv4 uses one port (TCP 2049) and supports Kerberos; NFSv3 also needs rpcbind and helper ports.
1. Server: exportfs -v — export and options.
2. Client: showmount -e <server> (v3) or mount test.
3. Firewall: 2049 (and rpcbind 111 for v3).
4. Mount: mount -t nfs4 <server>:/path /mnt.
5. Permissions/UID mapping on files.
export defined → nfs-server running → client mounts → requests carried on 2049 → UID/GID checked on the server
For File Services → NFS, continue with the first unproven Topic check: Pin NFS version, server/export, client mountpoint/options, client source and effective UID/GIDs. If that boundary is healthy, advance to the adjacent check: Verify effective export policy and server listener/service state for that version. Preserve the same host/time/identity scope and rerun the original workload before accepting recovery.
Continue only after interpreting the current observation.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 Operational evidence path Verify boundary
export definition → NFS/RPC service → network → version negotiation → client mount → UID/GID or idmapping → export policy → backend filesystem → NFS operation
Healthy evidence: export is effective, expected NFS version negotiates, client identity maps as intended and required operations succeed consistently
Step 2 Verification and output interpretation Verify boundary
Existing fast checks for this Topic. - Pin NFS version, server/export, client mountpoint/options, client source and effective UID/GIDs.
- Verify effective export policy and server listener/service state for that version.
- Test mount/session and one real read/write/metadata operation while correlating client/server logs.
- Fix only the confirmed export/network/identity/filesystem cause, then remount if necessary and repeat the original operation.
Verification chain. export definition → NFS/RPC service → network → version negotiation → client mount → UID/GID or idmapping → export policy → backend filesystem → NFS operation
Step 3 Specialized verification Verify boundary
Confirm the client’s exact mount source, version and options, then perform a controlled read/write/stat under the real identity. On the server, verify the export and backing filesystem and correlate logs/counters around the same operation. For hangs, distinguish transport reachability, server responsiveness, lock/state recovery and backing-storage latency. After remount/recovery, repeat the original workload rather than relying on mount output alone.
Step 4 Commands Verify boundary
exportfs -v
showmount -e localhost
nfsstat -m
rpcinfo -p
Step 5 Failure modes and next checks Narrow the fault
Suspicious evidence: export list appears correct but client scope/options differ, UID/GID mapping surprises access, stale file handles or version/firewall dependencies fail, or mounted state persists while I/O is broken
Step 6 Special cases and limits Narrow the fault
A mounted NFS filesystem can be stale, blocked or disconnected. UID/GID mapping and root squashing can deny access despite permissive local-looking mode bits. Network ping does not show the NFS service path, and server export visibility does not show backing storage health. Caching can delay visibility between clients. Keep client VFS/cache, network/protocol state, export policy and server filesystem separate.
Step 7 Common mistakes Narrow the fault
no_root_squashon shared exports.- Mismatched NFS versions between client and server.
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.
Prefer NFSv4. Permissions are by UID/GID unless Kerberos and ID mapping are used — keep IDs consistent. root_squash (default) maps client root to nobody.
showmount -e <server> / exportfs -v— NFS exportsfindmnt -t nfs,nfs4,cifs— mounted network sharessmbclient -L //<server> -U <user>— SMB sharestestparm -s— Samba configuration check
ReferenceImportant terms & boundaries6 sections · depth on demand
What this shows and what it does not
NFS is confirmed only when the expected client using the intended NFS version and identity successfully performs the required operation on the intended export.
In depth
NFS: versions, behaviour and reliability
NFS lets clients mount a remote file system as if it were local. The nfs(5) manual page describes how the Linux client behaves:
- Without a version option, it tries NFS 4.2 first and negotiates down.
- TCP is the default transport.
- NFSv4 clients connect directly to port 2049, without rpcbind.
hardmounts (the default) retry indefinitely.softmounts return an error after a number of retries, and the manual warns that soft timeouts can cause silent data corruption.- With TCP,
timeodefaults to 60 seconds, and the timeout grows linearly with each retransmission. rsize/wsizeare negotiated, up to 1 MiB.nconnectcan open up to 16 connections to one server.sec=choosessys,krb5,krb5i(integrity) orkrb5p(privacy).
NFS versions
| Version | Characteristics |
|---|---|
| NFSv3 | Stateless; needs rpcbind, mountd and lockd on extra ports |
| NFSv4.0 | One port (2049); stateful; integrated locking; ACLs |
| NFSv4.1 | Sessions; pNFS (parallel NFS) |
| NFSv4.2 | Server-side copy, sparse files, labelled NFS (SELinux) |
Hard and soft mounts
| hard (default) | soft | |
|---|---|---|
| Server unavailable | Processes wait until it returns | I/O errors after the retries |
| Data safety | Safe | Risk of silent corruption (manual) |
| Typical symptom | Processes stuck in D state | Applications see EIO |
Diagnostics
| Task | Command |
|---|---|
| Mounts and negotiated options | nfsstat -m, findmnt -t nfs4 |
| Client statistics, retransmissions | nfsstat -c, mountstats |
| Server reachable on 2049? | nc -zv nas1 2049 |
| Hung mount | Processes in D state; dmesg | grep "not responding" |
host$ nfsstat -m
/home from nas1.example.net:/srv/nfs/home
Flags: rw,relatime,vers=4.2,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,nconnect=4,timeo=600,retrans=2,sec=sys,clientaddr=10.110.0.64
host$ nfsstat -c | sed -n '1,4p'
Client rpc stats:
calls retrans authrefrsh
1812044 37 1812081
host$ dmesg | grep -i "nfs: server" | tail -2
nfs: server nas1.example.net not responding, still trying
nfs: server nas1.example.net OK
Reading the example
The mount negotiated NFS 4.2 with 1 MiB transfers over four TCP connections, using hard semantics. 37 retransmissions in 1.8 million calls is low. The kernel messages show a short outage. With a hard mount, processes simply waited, and continued without errors once the server came back.
Documented example, not captured output.
How it works at runtime
NFS is part of File Services → NFS. NFS provides remote filesystem semantics through exports, RPC/NFS services, client mount options, identity mapping and server-side filesystem authorization; protocol version materially changes behavior.
Runtime state ownership and mechanics. NFS and SMB expose remote filesystems through distinct protocol, authentication, caching and locking semantics. NFS depends on export policy, client identity and RPC/NFS version behavior; SMB adds session authentication, share policy and dialect/security negotiation.
Topic-specific state model. NFS provides remote filesystem semantics through exports, RPC/NFS services, client mount options, identity mapping and server-side filesystem authorization; protocol version materially changes behavior.
Technical metadata. Linux distribution + service/version + client/server/time + DNS/route/firewall + listener/socket + HTTP/TLS/vhost/proxy or NFS/SMB session + identity mapping + backend path/upstream + original workload result.
Interpretation rule. - showmount/export visibility ≠ NFS I/O authorization.
- A mount entry ≠ current server reachability or working I/O.
- Matching usernames ≠ matching numeric UID/GID semantics.
- NFSv3 behavior/dependencies ≠ NFSv4 behavior/dependencies.
Specialized mechanics
NFS exposes a remote filesystem through kernel/client protocol state, server exports and the server’s backing filesystem. NFSv4 has a stateful namespace and integrated protocol behavior that differs from older RPC service composition; locking, leases, caching and recovery can affect observed I/O. Client VFS presents a normal-looking mount, but each operation can still depend on network, server state and identity mapping. Mount presence is therefore weaker evidence than a successful operation.
Quick reference
NFS on Linux: server exports directories, clients mount them; NFSv4 uses only TCP 2049, NFSv3 additionally rpcbind (111) and mountd/statd/lockd.
rpcinfo -p nfs01 # v3 services
showmount -e nfs01 # v3 export list
nfsstat -c; nfsstat -s
cat /proc/fs/nfsd/versions
Identity: AUTH_SYS trusts client UIDs; Kerberos (sec=krb5p) authenticates users and encrypts. NFSv4 ID mapping needs the same domain in /etc/idmapd.conf on both sides.
Limits and how it fails
Primary failure point. NFS is confirmed only when the expected client using the intended NFS version and identity successfully performs the required operation on the intended export.
NFS root squashing/UID mapping and SMB account/share ACLs can deny access even when Unix mode bits appear permissive. DNS success does not show protocol reachability.
ReferenceConfiguration & state2 sections · depth on demand
Configuration, persistence and lifecycle
Distribution/platform context. NFS owns protocol/export semantics; NFS Server and NFS Client split role-specific operation, while permissions and storage own backend state.
Specialized lifecycle
Choose NFS version and mount options based on availability and consistency requirements. Use stable server/export identity and document hard/soft, timeout/retrans and cache-related options because they change failure semantics. Server export policy and identity mapping must align with filesystem ownership. Persistent client mounts should integrate with network/boot ordering without making remote outages unexpectedly block boot. Avoid “soft” as a generic fix for hangs without understanding application data-safety implications.
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 File Services → NFS. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://www.samba.org/samba/docs/ · confidence 94%Authoritative Linux project/vendor documentation reviewed for bounded reference claims: NFS mount semantics, protocol versions, caching and recovery behavior. Documentation-based technical verification only; not lab or production-runtime proof. The schema vendor_doc method is used for authoritative project/vendor documentation; deployment applicability remains separate evidence.
Basis: https://man7.org/linux/man-pages/man5/nfs.5.html · confidence 93%What changed and what may be affected
Recent technical edits are separated from ordinary page timestamps. Relationship impact is advisory: it identifies nearby canonical references to review, not automatic breakage.
Terms & aliases
Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.
Quick lookup tables
NFS operational reference
Topic-specific lookup boundaries, proof limits and next-step Evidence for NFS.
| Lookup boundary | Topic-specific reference | Operational use |
|---|---|---|
| Scope / effective state | NFS provides remote filesystem semantics through exports, RPC/NFS services, client mount options, identity mapping and server-side filesystem authorization; protocol version materially changes behavior. | Establish exactly what this Topic owns before crossing into another subsystem. |
| Fast verification | Pin exact client/server + time + request/file operation → identify authoritative configuration → read back effective service/listener/session state → trace protocol selection/auth/identity → verify backend/upstream boundary → correlate logs → make smallest persistent change → repeat original workload + regression check. | Use the shortest evidence path first; a fast check is a boundary test, not blanket proof. |
| Verification chain | export definition → NFS/RPC service → network → version negotiation → client mount → UID/GID or idmapping → export policy → backend filesystem → NFS operation | Trace requested/configured state through effective state to the observed workload result. |
| Failure boundary | NFS is proven only when the expected client using the intended NFS version and identity successfully performs the required operation on the intended export. | Stop broad troubleshooting at the first boundary that is not supported by evidence. |
| Positive evidence | Correlated Linux web/file-service evidence can establish this proof path: export definition → NFS/RPC service → network → version negotiation → client mount → UID/GID or idmapping → export policy → backend filesystem → NFS operation | Use this observation only for the specific claim it actually supports. |
| Evidence limit | It does not independently prove unobserved clients, names, identities, routes, sessions, backends or time periods. NFS is proven only when the expected client using the intended NFS version and identity successfully performs the required operation on the intended export. | Do not promote a local success signal into end-to-end or adjacent-dependency proof. |
| Next troubleshooting check | Continue from the first unproven service boundary, capture adjacent effective state and protocol/application evidence, make only the demonstrated persistent change, then repeat the original client workload plus a regression check. | Continue to the next unresolved boundary while preserving the original test condition. |
NFS · operational reference
Compact Linux state, persistence, verification and boundary reference for fast lookup.
| Reference boundary | NFS |
|---|---|
| Topic path | File Services → NFS |
| Runtime state | NFS provides remote filesystem semantics through exports, RPC/NFS services, client mount options, identity mapping and server-side filesystem authorization; protocol version materially changes behavior. |
| Fast checks | - Pin NFS version, server/export, client mountpoint/options, client source and effective UID/GIDs. - Verify effective export policy and server listener/service state for that version. - Test mount/session and one real read/write/metadata operation while correlating client/server logs. - Fix only the proven export/network/identity/filesystem cause, then remount if necessary and repeat the original operation. |
| Verification chain | export definition → NFS/RPC service → network → version negotiation → client mount → UID/GID or idmapping → export policy → backend filesystem → NFS operation Boundary chain: local authoritative state → adjacent dependency → effective/programmed state → original workload/request → return/regression → explicit Evidence boundary. |
| Failure boundary | NFS is proven only when the expected client using the intended NFS version and identity successfully performs the required operation on the intended export. Boundary chain: unit config/drop-ins → dependency/order/condition → exec/process → readiness/active state → owned socket/file/device → dependent client/workload. |
| Persistence rule | Prove which configuration source owns the state, then prove that the running consumer loaded or generated the intended state. |
NFS · specialized operational reference
Topic-specific Linux mechanics, lifecycle, proof path and failure-boundary lookup.
| Operational boundary | Topic-specific reference |
|---|---|
| Client state | mount source + NFS version/options + VFS operation |
| Server state | export policy + identity mapping + backing FS |
| Failure planes | network · protocol state/locks · storage |
| Proof | Original read/write under real identity completes |