Pcornel
Browse topics
Options
Recent
Favorites
Linux · Technical reference

NFS

Direct answer

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.

When to use this

Use it for file sharing between Linux/Unix systems, such as home directories or shared data.

First 30 seconds

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.

Operational verification

export defined → nfs-server running → client mounts → requests carried on 2049 → UID/GID checked on the server

Evidence · next step

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
Platform / version applicability
linux
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

Platformlinux
Scope / prerequisiteUse it for file sharing between Linux/Unix systems, such as home directories or shared data.
What next?3 suggested next steps
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

7 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

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_squash on shared exports.
  • Mismatched NFS versions between client and server.
Evidence references

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.

observation · 1
Key points

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.

Key checks
  • showmount -e <server> / exportfs -v — NFS exports
  • findmnt -t nfs,nfs4,cifs — mounted network shares
  • smbclient -L //<server> -U <user> — SMB shares
  • testparm -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.
  • hard mounts (the default) retry indefinitely. soft mounts return an error after a number of retries, and the manual warns that soft timeouts can cause silent data corruption.
  • With TCP, timeo defaults to 60 seconds, and the timeout grows linearly with each retransmission.
  • rsize/wsize are negotiated, up to 1 MiB.
  • nconnect can open up to 16 connections to one server.
  • sec= chooses sys, krb5, krb5i (integrity) or krb5p (privacy).

NFS versions

VersionCharacteristics
NFSv3Stateless; needs rpcbind, mountd and lockd on extra ports
NFSv4.0One port (2049); stateful; integrated locking; ACLs
NFSv4.1Sessions; pNFS (parallel NFS)
NFSv4.2Server-side copy, sparse files, labelled NFS (SELinux)

Hard and soft mounts

hard (default)soft
Server unavailableProcesses wait until it returnsI/O errors after the retries
Data safetySafeRisk of silent corruption (manual)
Typical symptomProcesses stuck in D stateApplications see EIO

Diagnostics

TaskCommand
Mounts and negotiated optionsnfsstat -m, findmnt -t nfs4
Client statistics, retransmissionsnfsstat -c, mountstats
Server reachable on 2049?nc -zv nas1 2049
Hung mountProcesses 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.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

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.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

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
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor doclinux current

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%
2026-09-13 · vendor docLinux NFS client current

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%
Technical changelog & impact

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.

Related reference impactReview these references after material technical changes when their shared boundary is affected.
Terminology layer

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.

Aliases that resolve here
nfsnetwork file systemnfs linux
Embedded reference data

Quick lookup tables

NFS operational reference

Topic-specific lookup boundaries, proof limits and next-step Evidence for NFS.

Lookup boundaryTopic-specific referenceOperational use
Scope / effective stateNFS 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 verificationPin 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 chainexport definition → NFS/RPC service → network → version negotiation → client mount → UID/GID or idmapping → export policy → backend filesystem → NFS operationTrace requested/configured state through effective state to the observed workload result.
Failure boundaryNFS 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 evidenceCorrelated 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 operationUse this observation only for the specific claim it actually supports.
Evidence limitIt 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 checkContinue 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 boundaryNFS
Topic pathFile Services → NFS
Runtime stateNFS 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 chainexport 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 boundaryNFS 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 ruleProve 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 boundaryTopic-specific reference
Client statemount source + NFS version/options + VFS operation
Server stateexport policy + identity mapping + backing FS
Failure planesnetwork · protocol state/locks · storage
ProofOriginal read/write under real identity completes
Confirmation

Confirm action

Continue?