Interview Prep/Linux/Storage, disks and filesystems

An NFS server will be down for maintenance and clients must not hang. How do you prepare the clients?

IntermediateScenarioStorage, disks and filesystems
Answer

Situation read → Hard mounts block processes in D state until the server returns.

What I'd do →

  1. Before maintenance, stop the apps that use the mount and umount /mnt/shared on clients.
  2. Long term, use autofs so the mount happens on access and expires when idle:
# /etc/auto.master.d/shared.autofs
/mnt  /etc/auto.shared  --timeout=300
# /etc/auto.shared
shared  -fstype=nfs4,rw  10.0.1.10:/exports/shared
  1. Only use soft,timeo= for read-only, non-critical data, because soft mounts can corrupt writes.

Why → Hard mounts protect data integrity; the price is hanging processes when the server is gone.

Interview tip → Showing you know that soft is a data-integrity trade-off scores points.

All Linux questions Roadmap: Linux

More on Storage, disks and filesystems