Interview Prep/Linux/Storage, disks and filesystems

A team wants a shared directory mounted on 10 app servers. How do you set up NFS?

BeginnerScenarioStorage, disks and filesystems
Answer

Situation read → NFS server export plus client mounts.

What I'd do →

  1. Server:
sudo dnf install -y nfs-utils    # or apt install nfs-kernel-server
sudo mkdir -p /exports/shared
echo '/exports/shared 10.0.1.0/24(rw,sync,root_squash)' | sudo tee -a /etc/exports
sudo systemctl enable --now nfs-server
sudo exportfs -rav
  1. Open firewall for NFSv4 (TCP 2049).
  2. Clients: 10.0.1.10:/exports/shared /mnt/shared nfs4 defaults,_netdev,nofail 0 0 in fstab, then mount -a.

Why → root_squash maps client root to nobody, so root on a client can't own the share. _netdev waits for the network at boot.

Interview tip → Say UIDs must match across clients (or use NFSv4 idmapping) otherwise ownership looks wrong.

All Linux questions Roadmap: Linux

More on Storage, disks and filesystems