December 5, 2026

/etc/fstab Explained: The Six Fields, UUIDs, nofail, and Testing an Entry Before It Breaks a Boot

An open computer case with two SATA drives and an NVMe drive installed

One wrong line in /etc/fstab can stop a Linux machine from booting, and the line usually looks fine. A drive that was unplugged, a UUID copied with one character off, an option spelled noatme: each sends the boot into emergency mode on many systems, at the moment the machine is hardest to fix. Every entry below was tested on Ubuntu 24.04 with util-linux 2.39.3, against a 64 MB ext4 filesystem image, using a separate test fstab file so the real one was never touched. The failures were produced on purpose, so the error messages are the real ones.

Video: Learn Linux TV on YouTube

The six fields

One line per filesystem

Each line in fstab describes one filesystem, in six whitespace-separated fields:

UUID=4ca98eae-6fa6-4a07-8ee0-8f0bb1bb078c  /mnt/t1  ext4  defaults,noatime  0  2

From left to right: what to mount, where to mount it, the filesystem type, the mount options, the dump flag and the fsck pass number.

What each field does

The first field names the device. The fstab manual describes it as the block device, remote filesystem or image to be mounted, normally a device node such as /dev/sdb1. The second is the mount point, a directory that must exist. The third is the filesystem type, such as ext4, xfs, vfat or nfs. The fourth is a comma-separated list of options.

The last two are numbers. The fifth field is used by the old dump backup tool and, per the manual, defaults to zero (don’t dump) if not present. The sixth sets the order of filesystem checks at boot: the root filesystem should be 1, other filesystems 2, and 0 means no check.

Both numbers can be left off

That default was tested. A line with only five fields, and another with only three (device, mount point, type), both passed findmnt --verify without an error, and the three-field line mounted with rw,relatime. Leaving them off is legal. Writing them out is clearer.

Shelf

Why UUID instead of /dev/sdb1

Device names are not stable

The fstab manual recommends LABEL= or UUID= over device names, because device names are often a coincidence of hardware detection order and can change when disks are added or removed. A second drive plugged in before boot can turn yesterday’s /dev/sdb into today’s /dev/sdc, and a line pointing at /dev/sdb1 then mounts the wrong disk, or nothing.

Finding the UUID

blkid prints the UUID, label and type of a filesystem:

$ blkid /dev/loop0
/dev/loop0: LABEL="DATA" UUID="4ca98eae-6fa6-4a07-8ee0-8f0bb1bb078c" BLOCK_SIZE="4096" TYPE="ext4"

The UUID belongs to the filesystem, written when it was created. Reformatting creates a new one, so after mkfs the fstab line has to be updated too. A label works the same way and is easier to read, but nothing stops two disks from carrying the same label.

Tested both ways

The test image mounted by UUID= and, in a separate run, by LABEL=DATA. Both resolved to the same loop device.

Mount options worth knowing

defaults, and what it really means

defaults is shorthand for the usual read-write behavior. The manual is careful about it: the default depends on the kernel and the filesystem. In the test, defaults came out as rw,relatime in findmnt, the relatime added by the kernel without being asked for.

noatime

Every read normally updates a file’s last-access time, a small write for every read. relatime already limits those updates; noatime stops them. The test entry with defaults,noatime mounted as rw,noatime.

Locking a mount down

An entry with ro,nosuid,nodev,noexec mounted as ro,nosuid,nodev,noexec,relatime, and an attempt to create a file on it failed:

touch: cannot touch '/mnt/t1/x': Read-only file system

These options suit a backup drive or a share that should only ever be read.

Creating the mount point

A line pointing at a directory that did not exist failed with mount point does not exist. Adding the util-linux option X-mount.mkdir made mount create the directory and succeed. Creating the directory by hand once is the more common approach.

Photo album

nofail: the option that keeps a missing disk from stopping the boot

Without it

An entry for a UUID that was not present, with plain defaults:

mount: /mnt/t2: can't find UUID=00000000-0000-0000-0000-000000000000.

mount -a exited with status 32. At boot on a systemd machine, a required mount that cannot be found is what drops the system into emergency mode after a wait.

With it

The same line with defaults,nofail produced no error and exit status 0. The fstab manual defines nofail simply as: do not report errors for this device if it does not exist. The systemd mount manual explains what that means at boot: the mount becomes only wanted, not required by the local filesystems target, and boot continues without waiting for it.

Pairing it with a timeout

Systemd also waits for a device to appear before giving up. The option x-systemd.device-timeout= sets how long, and the systemd manual notes it works only in /etc/fstab. For a USB drive that is sometimes unplugged, nofail,x-systemd.device-timeout=10s keeps a missing drive from costing more than ten seconds at boot. On systemd systems, fstab lines are turned into mount units by systemd-fstab-generator, which is why these x-systemd options are understood at all.

Lines that are not disks

Bind mounts

Not every fstab line names a disk. A bind mount makes an existing directory appear at a second place. The test line:

/srv/src  /mnt/bindt  none  bind,ro  0  0

mounted cleanly, and findmnt showed its source as the directory on the underlying disk, /dev/vda[/srv/src]. A file in /srv/src could be read through /mnt/bindt, and creating a new file there failed with Read-only file system. That is a common way to hand a container or a backup job one directory, read-only, without exposing the rest of the disk. The filesystem type field is ignored for a bind mount, which is why it says none, and the pass number should be 0: there is nothing separate for fsck to check.

tmpfs

A tmpfs line creates a filesystem held in memory, empty at every boot:

tmpfs  /mnt/tmpt  tmpfs  size=64m,mode=1777  0  0

The test mount showed size=65536k in its options and 64 MB free in df, and the directory permissions came out as 1777, the same sticky, world-writable mode /tmp uses. The size is a ceiling, not a reservation; memory is only used as files are written. Anything written there is gone after a reboot, which is the point: scratch space that never wears an SSD and never needs cleaning up.

Network shares

NFS and SMB shares also go in fstab, with their server address in the first field. They bring their own trouble, since the network may not be up when local disks are mounted. The nofail and timeout advice above applies to them even more strongly than to USB drives, because a server that is down at boot is common and nothing on the local machine can fix it.

Phone charging with a USB cable

Testing an entry without rebooting

findmnt –verify

findmnt --verify reads fstab and checks each line. Pointed at the test file with --tab-file, it reported:

/mnt/t2
   [ ] target exists
   [ ] userspace options: nofail
   [E] unreachable on boot required source: UUID=00000000-0000-0000-0000-000000000000
0 parse errors, 1 error, 1 warning

It caught the missing UUID before any boot. Note that in this version it still flagged the line as an error even with nofail present, so a flagged line is worth reading rather than ignoring.

mount -a with a test file

mount -a mounts everything in fstab that is not already mounted, which makes it the closest thing to a boot without rebooting. The -T option points it at another file, so new lines can be tried in a scratch file first:

mount -T /tmp/fstab.test -a -v

The typo it catches and the one it does not

A misspelled option, noatme, failed the mount with the generic wrong fs type, bad option, bad superblock message; the kernel log had the real reason, ext4: Unknown parameter 'noatme'. A wrong filesystem type (xfs for an ext4 disk) produced the same generic message. In both cases dmesg is where the useful line lives.

A safe order for a new line

Back up the file, add the line, run findmnt --verify, run mount -a, check with findmnt that the target is mounted with the expected options, and only then reboot. Every failure in this post showed up at the mount -a step, where fixing it takes a text editor instead of a rescue console. When the bad line is already in place

If a machine has already stopped at an emergency shell because of fstab, the root filesystem is often mounted read-only, so the file cannot be saved. The fix is to remount it read-write in place, then edit:

mount -o remount,rw /

The same remount was tested on the image: mounted ro, then mount -o remount,rw switched it to rw,relatime without unmounting, and a file could be written immediately after. Once root is writable, the bad line can be commented out with a #, which fstab treats as a comment, and the boot continues with exit or a reboot. Commenting out is safer than deleting: the line is still there to fix properly once the machine is up.

The earlier post on extending an LVM volume covers the other half of adding storage: making the volume bigger once it is mounted.

Sources

  • fstab(5), Linux manual page (man7.org): https://man7.org/linux/man-pages/man5/fstab.5.html
  • systemd.mount(5), Linux manual page (man7.org): https://man7.org/linux/man-pages/man5/systemd.mount.5.html

719 Posts

Peter Kalafatis writes and edits X9M8. He holds a bachelor's degree from LIU Post and a master's in Media Studies from The New School, with academic work in the philosophy of science, human behavior, AI, and memetics.

View All Posts

One Response to “/etc/fstab Explained: The Six Fields, UUIDs, nofail, and Testing an Entry Before It Breaks a Boot”

Leave a Reply

Your email address will not be published. Required fields are marked *