fstab, the file /etc/fstab, is the static filesystem table of a Linux system: a plain-text configuration file that lists which block devices, partitions, network shares and swap areas should be mounted, at which mount point, with which filesystem type and options. During boot the system reads it to assemble the directory tree from separate storage volumes, and tools such as mount consult it when an administrator mounts a filesystem by its mount point alone.
The file describes the intended, persistent state, not what is mounted right now. The live state is visible in /proc/mounts or through findmnt, and a difference between the two often points to a failed or manual mount.
The six fields of an fstab entry
Each non-comment line in fstab describes one filesystem in six whitespace-separated fields. Lines beginning with a hash sign are comments, and spaces inside paths must be written as the octal escape \040.
| Field | Meaning | Example value |
|---|---|---|
| 1. Device | What to mount, ideally by stable identifier | UUID=3f2a..., LABEL=data, server:/export |
| 2. Mount point | Directory where it appears | /, /home, /mnt/backup, none for swap |
| 3. Type | Filesystem type | ext4, xfs, btrfs, nfs, swap, tmpfs |
| 4. Options | Comma-separated mount options | defaults,noatime |
| 5. Dump | Legacy backup flag for the dump utility | Almost always 0 |
| 6. Pass | Order of the boot-time fsck check | 1 for root, 2 for others, 0 to skip |
A complete line for a data partition might read UUID=3f2a... /srv ext4 defaults,noatime 0 2. The pass field matters for ext-family filesystems; XFS and Btrfs perform their own consistency handling, so they are usually given 0 in that field.
Identifying devices reliably
Kernel device names such as /dev/sdb1 are assigned in detection order and can change when disks are added, removed or connected through a different controller. A system that mounts by such names may boot with the wrong disk in place or fail entirely. Modern installers therefore write persistent identifiers into fstab.
| Reference | Source of the value | Stability | Note |
|---|---|---|---|
| UUID= | Filesystem UUID, shown by blkid | High | Changes when the filesystem is recreated |
| PARTUUID= | GPT partition identifier | High | Survives reformatting of the partition |
| LABEL= | Filesystem label set by the admin | Medium | Duplicate labels cause conflicts |
| /dev/disk/by-id/ | Hardware serial-based symlink | High | Tied to one physical disk |
| /dev/sdX | Kernel enumeration order | Low | Avoid for permanent mounts |
| LVM or mapper path | Volume group and logical volume names | High | Stable while names stay unchanged |
Identifiers have their own trap. Cloning a disk with a block-level copy also clones its UUID, so two filesystems with the same identifier can appear on one machine and the wrong one may be mounted. After cloning, administrators assign a new UUID with the filesystem’s own tool, such as tune2fs -U for ext4 or xfs_admin -U for XFS, and update fstab to match.
Network filesystems are referenced differently: an NFS entry names the server and exported path, and a CIFS entry names a share such as //server/share. Credentials for CIFS should be kept in a separate file readable only by root and referenced with the credentials= option, never written directly into fstab, which every user can read.
Mount options that matter in practice
The options field controls behavior, performance and security of each mount. The keyword defaults expands to rw, suid, dev, exec, auto, nouser and async; additional options are appended after it.
| Option | Effect | Typical use |
|---|---|---|
| noatime | Stops access-time updates on reads | Reduces writes on busy or flash storage |
| nofail | Boot continues if the device is missing | External or secondary disks |
| _netdev | Waits for networking before mounting | NFS, CIFS and iSCSI volumes |
| x-systemd.automount | Mounts on first access instead of at boot | Network shares and slow devices |
| noexec, nosuid, nodev | Block programs, setuid bits or device files | Hardening /tmp and user-writable mounts |
| ro | Read-only mount | Recovery images and protected data |
| user or users | Lets ordinary users mount the entry | Removable media on desktops |
Filesystem-specific options are added in the same field, for example subvol=@home,compress=zstd for Btrfs subvolumes or size=2G for a tmpfs mount. Options a filesystem does not recognize usually make the mount fail.
How fstab is processed at boot
On distributions that use systemd, fstab is not read by a traditional script. The systemd-fstab-generator converts every line into a native mount unit or swap unit early in boot, and systemd then orders those units by dependencies. This is why changes to fstab require systemctl daemon-reload before they take effect for systemd-managed mounting.
Entries for the root filesystem and for filesystems needed by local-fs.target are critical by default: if one cannot be mounted, boot stops in emergency mode. Adding nofail to non-essential entries prevents a missing USB disk or an unreachable NAS from blocking the whole system.
Editing fstab safely
A single typo in fstab can make a server unbootable, so experienced administrators follow a fixed routine before rebooting.
- Back up the file before editing, for example to /etc/fstab.bak.
- Copy identifiers from `blkid` or `lsblk -f` rather than typing them by hand.
- Run
findmnt --verifyto detect syntax and type errors. - Run
systemctl daemon-reloadand thenmount -ato mount all new entries without rebooting. - Confirm the result with
findmntordf -hbefore the next restart.
On remote or cloud machines without console access, a broken fstab can mean a lost server, because emergency mode waits for a local login. Marking new data volumes with nofail and testing with mount -a are therefore not optional precautions but standard operating practice.
A plain-language summary
fstab is a short list that tells Linux where to attach each disk when the computer starts. A computer may have several drives, partitions or network folders. Linux joins them into one tree of folders, and fstab says which piece goes where.
It works like a seating plan for a dinner. Each guest, meaning each disk, has a named seat, meaning a folder. If the plan has a mistake, the evening can start badly, and the computer may refuse to start normally until someone corrects the list.
An example from practice
An administrator adds a new 2 TB data disk to a web server and wants it permanently available at /srv/data. She formats it with ext4, runs blkid to read its UUID and appends one line: the UUID, /srv/data, ext4, the options defaults,noatime,nofail, then 0 and 2.
Before rebooting, she runs findmnt --verify, which reports no problems, then systemctl daemon-reload and mount -a. The disk appears at /srv/data with the expected size. Weeks later the disk fails and is removed for replacement. Thanks to nofail, the server still boots normally and keeps serving the website, while monitoring reports the missing mount to the team.