RHCSAv10 · RHEL 10

Exercises

Exercise: NFS mount + autofs

updated 2026-10-19 by seed

Tasks (NFS server: 192.168.130.40, export /share)

  1. Mount /share on /mnt/share as ro,soft, persistently.
  2. Mount the same export on demand on /mnt/auto/share with autofs.
  3. Prove no mount exists before the first ls.
  4. Check that mount -a breaks nothing.

Verify

findmnt /mnt/share
ls /mnt/auto/share >/dev/null && findmnt /mnt/auto/share
grep -c nfs /etc/fstab           # 1

Solution

sudo dnf install -y nfs-utils autofs
echo '192.168.130.40:/share /mnt/share nfs ro,soft 0 0' | sudo tee -a /etc/fstab
sudo mkdir -p /mnt/share && sudo mount -a
echo '/mnt/auto /etc/auto.share --timeout=60' | sudo tee /etc/auto.master.d/share.autofs
echo 'share -ro,soft 192.168.130.40:/share' | sudo tee /etc/auto.share
sudo systemctl enable --now autofs