Interview Prep/Linux/Disk space, inodes and filesystems

An NFS client shows `df` hanging forever, and the shell becomes unusable.

IntermediateTroubleshootingDisk space, inodes and filesystems
Answer

Likely causes → An NFS server is unreachable and the mount is hard, so statfs() blocks in D state.

Diagnose →

mount -t nfs,nfs4
df -h -x nfs -x nfs4          # works without touching NFS
rpcinfo -t nfsserver nfs 4 ; showmount -e nfsserver
ps -eo pid,stat,cmd | awk '$2 ~ /D/'

Fix → Restore the server or network. If the server is gone for good, umount -f -l /mnt/share.

Prevent → Use autofs for rarely used shares; monitor NFS servers; avoid NFS mounts on paths that system tools scan.

All Linux questions Roadmap: Linux

More on Disk space, inodes and filesystems