Pcornel
Linux · Filesystems & Mounting

/etc/fstab

Cheat sheet · https://pcornel.dk/topic.php?topic=369

Back to the Topic

Answer

/etc/fstab lists the filesystems Linux mounts at every boot: what to mount, where, as which type and with which options — one line of six fields each.

Remember

A line that cannot be mounted halts the boot unless it has nofail. Identify devices by UUID=, not /dev/sdb1. Network filesystems need _netdev. Test every change before rebooting: findmnt --verify, then mount -a.

First checks

  • findmnt --verify — checks the file for errors.
  • mount -a — mounts everything listed that is not mounted; shows failures now.
  • findmnt <mount point> — what is mounted there, with which options.
  • blkid or lsblk -f — UUIDs and filesystem types.
  • systemctl daemon-reload — make systemd read the edited file.

Commands

findmnt
mount -a
findmnt --verify
systemctl daemon-reload
findmnt /srv/data
lsblk -f
mount -o remount,rw /

Verify in this order

line with six valid fields → device found by UUID → mount point exists → filesystem type and options accepted → mounted at boot (or skipped with nofail) → visible in findmnt

Where it usually breaks

First mismatch in hardware/block device → kernel driver/mapper/RAID/LVM → filesystem → mount namespace/options → path permissions/MAC → consumer I/O; preserve identity/native diagnostic/pre-state before mutation.

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=369

Confirmation

Confirm action

Continue?