Study guide

8.2 Persistent Mounts: /etc/fstab, UUIDs & systemd mount units (104.3)

LPIC-1 Linux Administrator — Exam 101 101-500

Track your progress as you read

Finished sections get a check mark.

1 Exam Overview & Study Strategy

1.1 LPIC-1 101-500 Exam Structure & Blueprint 1.2 Command Line & Shell Fundamentals for Exam Success 1.3 Fill-in-the-Blank Strategies & Common Traps

2 Topic 101: System Architecture

2.1 Hardware Discovery, Sysfs, Procfs & Kernel Modules (101.1) 2.2 Udev, Dbus & Device Management (101.1) 2.3 BIOS vs. UEFI & System Boot Process (101.2) 2.4 Kernel Initialization, Initramfs & System Logs (101.2) 2.5 Systemd Boot Targets & Unit Management (101.3) 2.6 SysVinit Runlevels, Telinit & System Shutdown (101.3)

3 Topic 102: Linux Installation & Boot Management

3.1 Hard Disk Layout, Partition Schemes & Swap Design (102.1) 3.2 LVM & Standard Mount Point Allocation (102.1) 3.3 GRUB 2 Configuration & Troubleshooting (102.2) 3.4 Legacy GRUB & Alternative Boot Loaders (102.2) 3.5 Managing Shared Libraries & ldconfig (102.3) 3.6 Linux as a Virtualization Guest & Cloud Instances (102.6)

4 Topic 102: Package Management Systems

4.1 Debian Low-Level Package Management with dpkg (102.4) 4.2 High-Level Debian Package Management: apt, apt-get & apt-cache (102.4) 4.3 RPM Package Management with rpm (102.5) 4.4 YUM, DNF & Zypper Package Management (102.5) 4.5 Package Repositories & Integrity Verification (102.4/102.5) 4.6 Universal Linux Packages: Snap, Flatpak & AppImage (102.4/102.5)

5 Topic 103: Command Line & Text Processing

5.1 Shell Environment, Environment Variables & Aliases (103.1) 5.2 Command History, Quoting & Expansion (103.1) 5.3 Basic Text Filters: cat, head, tail, cut, paste, nl, od (103.2) 5.4 Advanced Text Filters: sort, uniq, wc, tr, split, less & Checksums (103.2) 5.5 Stream Editing with sed (103.2) 5.6 Basic File Management: cp, mv, rm, touch, mkdir, rmdir (103.3) 5.7 Archiving and Compression: tar, gzip, bzip2, xz, cpio & dd (103.3)

6 Topic 103: Streams, Processes, Regex & Vi

6.1 Standard Streams, Redirection & File Descriptors (103.4) 6.2 Pipelines, tee & xargs (103.4) 6.3 Process Monitoring: ps, top, free, watch, pgrep, pstree & uptime (103.5) 6.4 Signals, kill, Job Control, nohup, screen & tmux (103.5) 6.5 Process Priorities: nice & renice (103.6) 6.6 Regular Expressions & grep, egrep, fgrep (103.7) 6.7 vi / vim Modes, plus nano, Emacs & EDITOR Awareness (103.8)

7 Topic 104: Devices, Partitions & Filesystems

7.1 Block Devices, fdisk & gdisk (104.1) 7.2 GNU Parted & Partition Table Management (104.1) 7.3 Creating Filesystems: mkfs, ext4, XFS, VFAT/exFAT & Btrfs (104.1) 7.4 Filesystem Integrity: fsck, e2fsck, xfs_repair, xfs_fsr & xfs_db (104.2) 7.5 Monitoring Disk Usage: df, du & tune2fs (104.2) 7.6 Managing Swap Space: mkswap, swapon & swapoff (104.1/104.2)

8 Topic 104: Mounts, Permissions, Links & FHS

8.1 Mounting and Unmounting Filesystems: mount & umount (104.3) 8.2 Persistent Mounts: /etc/fstab, UUIDs & systemd mount units (104.3) 8.3 Standard File Permissions: chmod, chown, chgrp & umask (104.5) 8.4 Special Permissions: SUID, SGID & Sticky Bit (104.5) 8.5 Hard Links vs. Symbolic Links: ln & Inodes (104.6) 8.6 Filesystem Hierarchy Standard (FHS) & File Location (104.7)

8.2 Persistent Mounts: /etc/fstab, UUIDs & systemd mount units (104.3)

Key Takeaways Explain This Topic AI

The /etc/fstab (File System Table) configuration file defines static filesystem mounting rules evaluated during system boot and when executing mount -a .

Each entry in /etc/fstab consists of exactly six whitespace-separated fields: Device Identifier, Mount Point, Filesystem Type, Mount Options, Dump Frequency, and Fsck Pass Order.

Using persistent identifiers such as UUID=... or LABEL=... instead of volatile device paths ( /dev/sda1 ) prevents boot failures caused by drive reordering during storage controller enumeration.

The sixth field ( fsck pass order) dictates boot-time filesystem integrity checking: 1 is reserved exclusively for the root ( / ) filesystem, 2 is used for other local physical filesystems, and 0 disables checks (mandatory for swap, tmpfs, and modern filesystems like XFS and Btrfs).

Systemd automatically parses /etc/fstab at boot using systemd-fstab-generator , creating native .mount and .automount units in /run/systemd/generator/ using escaped path naming (e.g., /var/log becomes var-log.mount ).

Last updated: August 2026

8.2 Persistent Mounts: /etc/fstab, UUIDs & systemd mount units

Quick Summary: Filesystem attachments made manually using the mount command are temporary and do not survive a system reboot. To make mounts persistent, Linux reads the /etc/fstab (File System Table) configuration file during system startup. Every line in /etc/fstab defines a storage device, its designated mount point, its filesystem type, specific mount options, dump backup scheduling, and filesystem integrity check ( fsck ) order. Modern Linux distributions convert /etc/fstab entries dynamically into native systemd .mount units. Mastering /etc/fstab column structure, persistent identifiers ( UUID , LABEL ), and verification techniques ( mount -a ) is a core LPIC-1 competency.

1. Anatomy of the /etc/fstab Configuration File

The /etc/fstab file is plain text. Blank lines and lines beginning with a hash mark ( # ) are treated as comments and ignored by the parser. Each active entry consists of exactly six whitespace-separated columns (spaces or tabs): # Sample /etc/fstab entry:

  • # [1. Device] [2. Mount] [3. Type] [4. Options] [5. Dump] [6. Pass]
  • UUID=4a92c3d1-81f2-4e02-990a-1123456789ab / ext4 defaults,noatime 0 1
  • UUID=9f8e7d6c-5b4a-3210-fedc-ba9876543210 /home xfs defaults,nodev,nosuid 0 0
  • LABEL=BACKUP_DATA /mnt/backup ext4 defaults,noauto,user 0 2
  • /dev/sr0 /media/cdrom iso9660 ro,user,noauto 0 0
  • /dev/sda3 none swap sw 0 0
  • 192.168.1.50:/exports/data /mnt/nfs nfs _netdev,defaults 0 0
  • The 6 /etc/fstab Columns Reference Table

Column Field Name Permitted Values & Common Formats Functional Purpose

1 Device / File System UUID=... , LABEL=... , PARTUUID=... , /dev/sda1 , server:/share , tmpfs , proc , none Identifies the physical block device, network share, or virtual pseudo-filesystem to be mounted.

2 Mount Point Absolute directory path (e.g., / , /boot , /home , /var ), or none / swap for swap space Specifies the target directory in the VFS hierarchy where the filesystem will be attached.

3 Filesystem Type ext4 , xfs , btrfs , vfat , iso9660 , swap , nfs , auto Defines the driver needed to parse the filesystem data structures.

4 Mount Options Comma-separated list with no spaces (e.g., defaults , ro , noexec , nosuid , noatime , nofail , _netdev ) Controls operational parameters, permissions, caching, and startup dependencies.

5 Dump Frequency 0 (do not dump) or 1 (dump backup enabled) Used by the legacy dump backup utility to determine if the filesystem needs backup. Almost universally set to 0 on modern systems.

6 Fsck Pass Order 0 (no boot check), 1 (checked first; reserved for / ), 2 (checked second; other local filesystems) Dictates the order in which fsck scans and repairs filesystems during boot.

  • 2. Field-by-Field Technical Breakdown
  • Field 1: Device Identifiers (UUID vs. LABEL vs. Device Nodes)

Using traditional device paths like /dev/sda1 in /etc/fstab is dangerous in modern systems. When storage hardware changes, controllers reinitialize, or USB drives are inserted, kernel device enumeration order can shift, causing /dev/sda1 to become /dev/sdb1 and leading to boot failure.

To prevent this, Linux supports persistent device naming:

UUID= (Universally Unique Identifier): A 128-bit hex string stored in the filesystem superblock (e.g., UUID=4a92c3d1-81f2-4e02-990a-1123456789ab ). It remains constant even if the drive is moved to another SATA/NVMe port.

LABEL= : A human-readable volume label assigned during filesystem creation or via tools like e2label or xfs_admin -L (e.g., LABEL=ROOT_OS or LABEL=BACKUP ).

PARTUUID= / PARTLABEL= : Identifiers stored in the GPT partition table rather than the filesystem superblock. # Inspect UUIDs and Filesystem Types using blkid:

  • $ sudo blkid
  • /dev/sda1: UUID="4a92c3d1-81f2-4e02-990a-1123456789ab" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="000a12bc-01"
  • /dev/sda2: UUID="9f8e7d6c-5b4a-3210-fedc-ba9876543210" BLOCK_SIZE="512" TYPE="xfs" PARTUUID="000a12bc-02"

# Inspect block devices, UUIDs, and mount points using lsblk:

  • $ lsblk -f
  • NAME FSTYPE FSVER LABEL UUID FSAVAIL FSUSE% MOUNTPOINTS
  • sda
  • ├─sda1 ext4 1.0 ROOT 4a92c3d1-81f2-4e02-990a-1123456789ab 18.2G 48% /
  • └─sda2 xfs HOME 9f8e7d6c-5b4a-3210-fedc-ba9876543210 82.4G 12% /home
  • Field 4: Critical Mount Options in /etc/fstab

defaults : Expands automatically to: rw,suid,dev,exec,auto,nouser,async .

nofail : Prevents system boot failure and avoids dropping to emergency mode if the device is disconnected or fails to mount.

_netdev : Instructs systemd and init scripts to delay mounting until network connectivity is active (mandatory for NFS, iSCSI, and CIFS shares).

usrquota / grpquota : Enables user or group disk quota enforcement on ext4/XFS filesystems.

Field 6: Fsck Pass Order Rules (Exam Hotspot)

The sixth column determines how fsck behaves at boot:

1 : Root filesystem ( / ) ONLY. The root filesystem must be checked first before any other services or mounts initialize.

2 : All other local filesystems requiring boot-time integrity scans (e.g., /home , /var ). All filesystems marked 2 are checked in parallel across physical spindles.

0 : Disable fsck scanning. Mandatory for:

  • Swap partitions ( swap )
  • Virtual filesystems ( proc , sysfs , tmpfs )
  • Optical media and ISOs ( iso9660 )
  • Network shares ( nfs , cifs )

Filesystems with internal journal replay engines that do not use fsck at boot, such as XFS and Btrfs .

⚠️ LPIC-1 Trap — Setting Fsck Pass Order for XFS: XFS has its own built-in metadata journaling and repair mechanisms executed during kernel mount. It does not run traditional fsck at boot. Setting column 6 to 1 or 2 for an XFS filesystem is an error; XFS entries in /etc/fstab should always have pass order set to 0 .

3. Safe Workflow for Modifying /etc/fstab

A syntax error in /etc/fstab (such as a missing column, a typo in a UUID, or an invalid mount option) can prevent the system from completing boot, forcing it into an emergency root shell.

Best Practice Procedure:

Always create a backup before editing: sudo cp /etc/fstab /etc/fstab.bak .

Add or modify the entry using a text editor.

Test the configuration immediately without rebooting by executing: $ sudo mount -a

If mount -a returns zero errors and mounts the target successfully, the configuration is safe for reboot.

💡 LPIC-1 Exam Fill-in-the-Blank Alert: Which command reads /etc/fstab and mounts all listed filesystems that do not have the noauto option, allowing administrators to verify syntax without rebooting? Answer: mount -a

4. systemd Mount Units and systemd-fstab-generator

In modern systemd-based Linux systems, filesystem mounting is managed natively by systemd unit files ending in .mount and .automount .

How systemd Integrates with /etc/fstab

During early boot, systemd invokes an internal binary called systemd-fstab-generator . This tool parses /etc/fstab and automatically generates native .mount unit files inside the transient runtime directory /run/systemd/generator/ . systemd-fstab-generator Workflow:

  • ┌──────────────┐ systemd-fstab-generator ┌────────────────────────────────┐
  • │ /etc/fstab │ ─────────────────────────────────>│ /run/systemd/generator/ │
  • └──────────────┘ (Executed at boot) │ ├── var-log.mount │
  • │ └── home.mount │
  • └────────────────────────────────┘
  • Mount Unit Naming Convention ( systemd-escape )

Systemd requires that .mount unit filenames strictly match the path of the mount point directory, with leading slashes stripped and all internal slashes replaced by dashes ( - ):

  • Mount point / → -.mount
  • Mount point /home → home.mount
  • Mount point /var/log → var-log.mount
  • Mount point /srv/web/data → srv-web-data.mount

Administrators can generate properly escaped unit names using the systemd-escape command: $ systemd-escape --path /var/log

var-log

  • $ systemd-escape --path --suffix=mount /srv/web/data
  • srv-web-data.mount

Inspecting and Managing Mount Units via systemctl # List all active mount units:

$ systemctl list-units --type=mount

# View the status of the /var/log mount unit generated from fstab:

$ systemctl status var-log.mount

# Reload systemd generators after editing /etc/fstab without rebooting:

$ sudo systemctl daemon-reload

Loading diagram... Persistent Mount Architecture: /etc/fstab to systemd Mount Units