LinuxXV · /etc/fstab and Mount Managementfstab syntax
fstab syntax - fields, options, and the dump/pass columns
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
/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
$ cat /etc/fstabUUID=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| Column | Meaning |
|---|---|
| 1. Filesystem | UUID, LABEL, PARTUUID, or device path |
| 2. Mount point | Absolute path; none for swap |
| 3. Filesystem type | ext4, xfs, btrfs, swap, nfs, etc.; auto to let the kernel detect |
| 4. Mount options | Comma-separated: defaults, noatime, errors=remount-ro, etc. |
| 5. Dump field | Legacy dump(8) flag: 0 = skip, 1 = include. Use 0. |
| 6. Pass field | fsck order: 0 = skip, 1 = root first, 2 = after root. |
Common mount options
$ 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)| Option | Meaning | When to use |
|---|---|---|
defaults | rw, suid, dev, exec, auto, nouser, async | Default baseline |
noatime | Skip access-time updates | Read-heavy workloads (3-5% throughput win) |
relatime | Update atime only if older than mtime/ctime | Compromise between correctness and performance |
errors=remount-ro | Remount read-only on filesystem error | Safer failure mode for production |
noexec | Forbid execution of binaries | /tmp, /var/tmp, removable media |
nodev | Forbid device-file interpretation | Filesystems that should not contain device files |
nosuid | Ignore setuid/setgid bits | Filesystems that should not honour privilege escalation |
_netdev | Wait for network before mounting | NFS, iSCSI, network filesystems |
nofail | Do not abort boot if this mount fails | Non-critical mounts |
fstab discipline
Knowledge check
Knowledge check · 3 questions
Q1. What does the pass column in /etc/fstab control?
Q2. In fstab, the device column can use a UUID, LABEL, PARTUUID, or /dev/sd* name.
Q3. Which of the following are correct for fstab? Select all that apply.
Passing score: 75%. Answers are checked in this browser.