OTOthoTools

fstab Inspector

Validate mounts and boot risks
Input
Result1 findings
  • No critical issue detected

Introduction

The fstab Inspector checks the six fields of every /etc/fstab entry: device, mount point, filesystem type, mount options, dump flag and fsck pass. Most boot failures and late-mount surprises come from exactly these fields being wrong.

fstab(5) is the system file that defines how block devices, network shares and filesystems are mounted at boot. A single malformed line can delay boot, skip a needed filesystem or, in the worst case, leave a service waiting on a mount that never arrives.

Objective

  • Detect entries that do not have exactly six whitespace-separated fields.
  • Detect duplicate mount points, which make mount behaviour ambiguous.
  • Flag network filesystems (NFS/NFSv4) that lack the _netdev option.
  • Validate the fsck pass field against the allowed values 0, 1 and 2.

Inputs

  • The content of /etc/fstab (paste), or a single mount line.
  • Comment lines starting with # and blank lines are ignored.

How it works

Each non-comment line is split on whitespace. If the line does not yield exactly six fields, the tool reports a high-severity finding with the line number and the number of fields found.

Valid lines are checked for duplicate mount points (column 2). If the filesystem type is nfs or nfs4 and the options field does not contain _netdev, a warning suggests adding it so the mount waits for networking. Finally, column 6 (fsck pass) must be 0, 1 or 2; anything else is flagged.

If no problem is found, the tool reports a clean result. The checks are deterministic — the same file always produces the same findings.

Testable example

Try it — the analysis runs locally in your browser.

Example

UUID=1a2b-3c4d / ext4 defaults 0 1
10.20.0.15:/srv/shared /mnt/shared nfs rw,hard,_netdev 0 0

Expected output

Line 1: OK — root filesystem with a valid fsck pass.
Line 2: OK — NFS mount with _netdev present.
Result: no critical issue detected.

Reading the output

  • A high finding means the line is malformed or dangerous as written; fix it before rebooting.
  • A warning means the entry will probably work but may surprise you at boot — for example a network mount without _netdev can stall the boot sequence.
  • A clean result only means these checks pass. It does not validate the device UUID, the export path or the mount options against the real server.

Risks

  • A wrong device or duplicate mount point can shadow a filesystem and hide data.
  • Network mounts without _netdev can make boot wait for an unreachable server.
  • An invalid fsck pass can skip a filesystem check or, with pass 1 on several devices, reorder checks.

Limitations

  • The tool does not verify that devices or NFS exports actually exist.
  • It does not parse exotic fstab syntax such as quoted paths or escaped spaces in device names.
  • It is a syntax and consistency check, not a mount test.

Official references

FAQ

What is the fsck pass column for?

Column 6 controls when fsck checks the filesystem at boot: 0 disables the check, 1 is the root filesystem, 2 is for other filesystems checked after the root. Values above 2 are not valid.

Why does _netdev matter for NFS?

Without _netdev the system may try to mount the NFS share before networking is up, which can stall boot. With _netdev (or a systemd automount) the mount waits for the network.

Does a clean result mean my mounts will work?

No. The tool checks structure and obvious mistakes only. A broken export path, an invalid UUID or a wrong server will still fail at mount time.