The Filesystem · Lesson 7 of 12
/etc/fstab
0 / 5 checkpoints answered
/etc/fstab, the filesystem table, declares filesystems, swap areas, bind mounts, network sources, and other attachments that system tools may mount or activate. Entries can participate in boot, but options such as noauto, automount integration, and service-manager policy affect when or whether that happens.
The Six Fields
A conventional entry has six whitespace-separated fields:
UUID=130b882f-7d79-436d-a096-1e594c92bb76 /data ext4 defaults,nosuid,nodev 0 2
- Source: a device path,
UUID=,LABEL=, network source, or another supported specification. - Target: mount point, or
nonefor uses such as swap where appropriate. - Type: filesystem type,
swap,none, or an accepted automatic type. - Options: a comma-separated list interpreted by mount helpers and integration layers.
- Dump field: historically controls the
dumpbackup utility;0commonly disables participation. - Pass field: controls boot-time
fsckordering where applicable;0disables automatic checking through this mechanism.
Whitespace inside a field must be escaped using fstab syntax such as \040 for a space. A # begins a comment outside a field.
CheckHow many fields does a normal /etc/fstab entry contain?
press 1/2/3 to answer · → next lesson
Stable Source Identifiers
For local filesystems, a filesystem UUID is often more stable than /dev/sdX enumeration:
$ lsblk -f
$ sudo blkid
Use UUID=... only after confirming the identifier belongs to the intended filesystem. Reformatting creates a new UUID, and block-level clones can duplicate one. PARTUUID= instead identifies a partition-table entry and has different semantics.
CheckWhat does UUID=... in the source field normally identify?
press 1/2/3 to answer · → next lesson
Mount Options and Check Fields
defaults expands to an implementation-defined conventional option set; it is not necessarily the safest policy for every mount. Add options based on trust and workload, such as read-only access or restrictions on device nodes and setuid behavior. Network and removable filesystems can need timeout, dependency, or failure-tolerance policy so boot does not stall unexpectedly.
For filesystems supported by fsck, the root filesystem conventionally uses pass 1 and other checked local filesystems pass 2. Filesystem-specific practice can differ—for example, some types do not use generic boot-time fsck—so follow the installed filesystem and distribution documentation rather than assigning 2 mechanically.
CheckWhat does a sixth-field value of 0 request?
press 1/2/3 to answer · → next lesson
Editing with a Recovery Path
An invalid root, boot, or required network entry can interrupt startup. Before editing:
- Confirm a current backup and console or rescue access.
- Copy the existing file while preserving permissions.
- Verify source identity and create the intended mount point.
- Make one scoped change.
- Validate and test before rebooting.
Do not put credentials directly in a world-readable fstab entry. Use the relevant mount helper's protected credential mechanism.
CheckWhy should rescue access be confirmed before changing a critical fstab entry?
press 1/2/3 to answer · → next lesson
Validating Without Assuming Success
Start with a static check where supported:
$ sudo findmnt --verify --verbose
Then test the specific new entry under controlled conditions, confirm it with findmnt, and unmount if the test was temporary. mount -a attempts many eligible entries and can contact networks or attach unintended sources; it also skips already mounted and noauto entries, so it is neither a harmless syntax checker nor complete proof.
On systemd-based systems, reload manager configuration after editing fstab so generated mount units are refreshed, then verify dependencies and boot behavior according to local documentation.
CheckWhy is mount -a not a complete fstab validation by itself?
press 1/2/3 to answer · → next lesson
Practice in Manage Linux Partitions and Filesystems with the lab's recovery-safe secondary storage.
Summary
You can now read and validate a persistent filesystem-table entry.
- Parse source, target, type, options, dump, and pass fields.
- Select a verified identifier with the intended identity semantics.
- Choose mount and checking policy for the actual filesystem.
- Preserve rescue access and make one scoped edit.
- Combine static validation, targeted mounting, and boot-policy checks.
Lesson complete
You finished /etc/fstab. Nice work — keep the momentum going.