criticalAdvancedUSE#nfs#mount#hang#d-state#network#io

NFS mount hang — processes stuck in D-state on NFS

Processes stuck in D (uninterruptible sleep) state

Likely source:availabilityconnectivity

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>
READ

Test network connectivity to the NFS server

Fix

umount -f -l <nfs-mount-point>
DESTRUCTIVE

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.

1
ps -eo pid,stat,wchan:20,cmd | grep '^\s*[0-9].*D'
READ

Confirm D-state processes are NFS-related

2
ping -c 3 <nfs-server-ip>
READ

Test NFS server reachability

3
mount | grep nfs
READ

Check mount options (hard/soft, timeo)

4
umount -f -l <nfs-mount-point>
DESTRUCTIVE

Force-lazy unmount to unblock stuck processes

5
mount -o soft,timeo=30,retrans=3 <nfs-server>:<path> <mount-point>
CHANGE

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.

Commands marked READ CHANGE DESTRUCTIVE — never run DESTRUCTIVE commands against production data you cannot restore. Copy → verify → execute.