You will configure resilient boot-time mounts for local and network filesystems on a server. By the end you will mount a local disk by UUID and an NFS share, both surviving reboot.

Learning Objectives

  • Write safe UUID-based fstab entries with the nofail option.
  • Mount an NFS share at boot.
  • Validate every entry without risking a boot hang.
  • Time: ~2 hours · Difficulty: Intermediate · Prereqs: a server plus a local disk and (optionally) an NFS export.

Architecture Overview

Environment Setup

You will need: util-linux, and nfs-common for the NFS portion.

Before you begin: know your disk UUID (blkid) and the NFS server export path.

Step-by-Step Execution

01
Add a local mount by UUID

UUIDs are stable across reboots; nofail avoids a boot hang if the disk is absent.

echo "UUID=$(blkid -s UUID -o value /dev/sdb1) /mnt/local ext4 defaults,nofail 0 2" | sudo tee -a /etc/fstab
[ROOT REQUIRED] Appends a persistent local mount entry.
02
Add an NFS mount

NFS lets multiple servers share centralized storage over the network.

echo "192.168.1.50:/export/share /mnt/share nfs defaults,_netdev,nofail 0 0" | sudo tee -a /etc/fstab
_netdev waits for the network before mounting.
03
Validate without rebooting
# mkdir -p /mnt/local /mnt/share && mount -a && findmnt /mnt/share
TARGET SOURCE FSTYPE OPTIONS /mnt/share 192.168.1.50:/export/share nfs4 rw,_netdev

Progress So Far

Testing & Validation

mount -a && df -hT /mnt/local /mnt/share

You should see both mounts with their filesystem types and no errors from mount -a. If clean, your mounts are boot-safe.

Troubleshooting
  • Boot hangs waiting for a mount: add nofail (and _netdev for network mounts).
  • NFS mount times out: confirm the export with showmount -e 192.168.1.50 and firewall on TCP/2049.
  • Permission denied on NFS: check the export's allowed clients and squash settings.

Extension Ideas

  • Replace fstab with a systemd .mount unit for dependency control.
  • Combine with LVM for flexible local capacity.
  • Secure NFS with Kerberos (sec=krb5p).

Key Results

  • Configured local and NFS mounts that persist across reboot.
  • Prevented boot hangs with nofail and _netdev options.
  • Validated entries safely with mount -a before reboot.
  • Centralized shared storage over NFS for multiple servers.