Skip to main content
RunBook Academy

LinuxXV · /etc/fstab and Mount Managementfstab syntax

fstab syntax - fields, options, and the dump/pass columns

Foundation⏱ ~10 minbashmountfindmntlsblkblkid

What you'll learn

  • Read and write /etc/fstab entries correctly
  • Choose mount options for production workloads
  • Use the dump and pass columns correctly
  • Diagnose fstab problems on boot

Prerequisites

Verified against Ubuntu 24.04 LTS · Debian 12 (Bookworm) · RHEL 9.x · Rocky Linux 9.x · AlmaLinux 9.x · Linux kernel 6.1 LTS / 6.6 LTS · systemd 255+ · OpenSSH 8.7p1 (RHEL 9) / 9.6p1 (Ubuntu 24.04) · nftables 1.0.x · chrony 4.x · Pacemaker 2.1.x · Corosync 3.1.x · 2026-08-09

Not yet marked complete on this device.

/etc/fstab lists the filesystems the host should mount. An error in it either prevents the host from booting or causes the affected filesystem to fail to mount.

Nothing in the kernel reads this file. On a systemd host, systemd-fstab-generator parses /etc/fstab early in boot and generates a .mount unit for each entry; systemd then orders and mounts them through the normal unit dependency graph, and systemd-fsck@.service runs the check. mount -a reads the file directly, but that is the mount command, not the kernel either.

That matters for troubleshooting, because it tells you where to look:

systemctl list-units --type=mount           # what was generated, and its state
systemctl cat data.mount                    # the unit generated from your entry
journalctl -u systemd-fstab-generator -b    # parse errors in the file itself

It also explains why the pass column is not what orders your mounts. Ordering comes from the unit dependencies systemd derives from the mount points (a mount at /var/log is ordered after /var because the path nests), while the sixth column only sets the fsck pass number.

The six columns

Read-only / Safefstab columns
$ cat /etc/fstab
UUID=1a2b-3c4d... /boot ext4 defaults 0 2
UUID=5e6f-7a8b... / ext4 defaults,noatime 0 1
UUID=9a8b-7c6d... /var ext4 defaults 0 2
UUID=f1e2-d3c4... swap swap defaults 0 0
ColumnMeaning
1. FilesystemUUID, LABEL, PARTUUID, or device path
2. Mount pointAbsolute path; none for swap
3. Filesystem typeext4, xfs, btrfs, swap, nfs, etc.; auto to let the kernel detect
4. Mount optionsComma-separated: defaults, noatime, errors=remount-ro, etc.
5. Dump fieldLegacy dump(8) flag: 0 = skip, 1 = include. Use 0.
6. Pass fieldfsck order: 0 = skip, 1 = root first, 2 = after root.

Common mount options

Read-only / Safemount output
$ mount | grep -E 'ext4|xfs|btrfs'
/dev/sda1 on /boot type ext4 (rw,relatime,seclabel)
/dev/sda2 on / type ext4 (rw,noatime,seclabel)
/dev/sda3 on /var type ext4 (rw,noatime,seclabel)
/dev/sdb1 on /data type ext4 (rw,noatime,seclabel)
OptionMeaningWhen to use
defaultsrw, suid, dev, exec, auto, nouser, asyncDefault baseline
noatimeSkip access-time updatesRead-heavy workloads (3-5% throughput win)
relatimeUpdate atime only if older than mtime/ctimeCompromise between correctness and performance
errors=remount-roRemount read-only on filesystem errorSafer failure mode for production
noexecForbid execution of binaries/tmp, /var/tmp, removable media
nodevForbid device-file interpretationFilesystems that should not contain device files
nosuidIgnore setuid/setgid bitsFilesystems that should not honour privilege escalation
_netdevWait for network before mountingNFS, iSCSI, network filesystems
nofailDo not abort boot if this mount failsNon-critical mounts

fstab discipline

Knowledge check

Knowledge check · 3 questions

  1. Q1. What does the pass column in /etc/fstab control?

  2. Q2. In fstab, the device column can use a UUID, LABEL, PARTUUID, or /dev/sd* name.

  3. Q3. Which of the following are correct for fstab? Select all that apply.

Passing score: 75%. Answers are checked in this browser.