NFS mount hang — processes stuck in D-state on NFS
Processes stuck in D (uninterruptible sleep) state
Focused incident mode — strips away everything but this runbook.
Symptoms
- Processes stuck in D (uninterruptible sleep) state
- ls or cat on NFS-mounted directory hangs indefinitely
- df or mount commands hang when touching NFS paths
Hard NFS mounts (the default) will hang a process forever if the server is unreachable. For non-critical data, always use soft mounts with a timeout to prevent D-state cascades.
Evidence to grab
Collect these artifacts before you change anything — they prove (or rule out) each cause.
D-state processes
ps -eo pid,stat,wchan:20,cmd | grep '^\s*[0-9].*D'NFS mount options
mount | grep nfs
Diagnostic flow
Run the steps in order, marking each claim confirmed or refuted. The evidence you gather feeds the ranked causes below.
Guided decision tree is ready.
Steps with commands, expected output, and pass/fail branches.
Ranked root causes
Evidence checklist
- showmount or ping to the NFS server times out
- D-state processes all show NFS wchan entries
Confirm before fixing
ping -c 3 <nfs-server-ip>Test network connectivity to the NFS server
Fix
umount -f -l <nfs-mount-point>Force-lazy unmount the hung NFS mount to unblock processes
Resolution runbook
Apply from top to bottom after the cause is confirmed. Review every command before running it — risk tags are shown on each.
ps -eo pid,stat,wchan:20,cmd | grep '^\s*[0-9].*D'Confirm D-state processes are NFS-related
ping -c 3 <nfs-server-ip>Test NFS server reachability
mount | grep nfsCheck mount options (hard/soft, timeo)
umount -f -l <nfs-mount-point>Force-lazy unmount to unblock stuck processes
mount -o soft,timeo=30,retrans=3 <nfs-server>:<path> <mount-point>Remount with safe NFS options
Prevention
- Use soft,timeo=30,retrans=3 mount options for NFS mounts that do not require strict consistency.
- Use autofs for NFS mounts so they disconnect cleanly when not in use.
- Monitor NFS server health and alert on high latency or packet loss.
- Use local storage or distributed filesystems (Ceph, GlusterFS) instead of NFS for critical data.
Related runbooks
Same stack, same failure family — worth a skim.
Commands marked READ CHANGE DESTRUCTIVE — never run DESTRUCTIVE commands against production data you cannot restore. Copy → verify → execute.