Fstab Check

Fstab Check

Paste /etc/fstab and your backup service unit. See whether the backup command can still start when its backup mount is missing, and which lines decide it.

Paste the whole file. Comments and blank lines are fine; line numbers match your file.

Paste every effective setting, with drop-ins already merged into one unit. systemctl cat lists the files to merge.

The mount your backup writes to.

Paste fstab and the backup service, then choose the mount.

The check assumes that mount is missing at startup and tells you whether the backup command can still run, with the lines that decide it.

What it does

When an NFS share or USB disk fails to mount, a backup service that only says After= the mount still starts, and the backup writes into the empty directory on your root disk. This page reads your fstab and service unit, assumes the chosen mount is missing, and tells you whether RequiresMountsFor=, ConditionPathIsMountPoint= or AssertPathIsMountPoint= stops the job, or whether nothing does.

Worked example: a nightly backup to a NAS

fstab
# /etc/fstab
UUID=3f1c9a2e-0b7d-4e51-9c1a-7d2e8b6f4a10  /                 ext4   defaults           0 1
UUID=8b2d-41F0                             /boot/efi         vfat   umask=0077         0 2

# NAS share for nightly backups
nas.example:/export/backup                 /mnt/backup-disk  nfs4   _netdev,nofail     0 0
Service, before
[Unit]
Description=Nightly backup to NAS
After=network-online.target mnt-backup\x2ddisk.mount

[Service]
Type=oneshot
ExecStart=/usr/local/bin/backup --to /mnt/backup-disk

UnguardedStartup can proceed. If the NAS is down, the backup runs anyway and fills the root disk.

fstab
# /etc/fstab
UUID=3f1c9a2e-0b7d-4e51-9c1a-7d2e8b6f4a10  /                 ext4   defaults           0 1
UUID=8b2d-41F0                             /boot/efi         vfat   umask=0077         0 2

# NAS share for nightly backups
nas.example:/export/backup                 /mnt/backup-disk  nfs4   _netdev,nofail     0 0
Service, after
[Unit]
Description=Nightly backup to NAS
After=network-online.target mnt-backup\x2ddisk.mount
RequiresMountsFor=/mnt/backup-disk

[Service]
Type=oneshot
ExecStart=/usr/local/bin/backup --to /mnt/backup-disk

GuardedStartup blocked if mounting fails. nofail on the fstab row does not change that.

How to use it

  1. Paste /etc/fstab.
  2. Paste the backup service with drop-ins merged in (systemctl cat shows them).
  3. Choose the backup mount and press Check backup startup. A red card means the backup can run without its mount.

What it does not do

Questions

Isn't After= enough?

No. After= only orders jobs that are already queued. It does not start the mount, and the service still starts if the mount fails.

Does nofail on the fstab row stop RequiresMountsFor= from working?

No. nofail keeps boot going if the mount fails. RequiresMountsFor= still pulls in the mount for this service and stops it starting if mounting fails.

Skip or fail: which guard should I use?

ConditionPathIsMountPoint= quietly skips the run. AssertPathIsMountPoint= marks the unit failed, so monitoring and OnFailure= see it. RequiresMountsFor= also tries to mount the path first.

Why "Indeterminate"?

Automounts, startup hooks, extra dependencies or unmerged drop-ins can change the answer in ways this page does not model. It names the line to review instead of guessing.

Is my configuration sent anywhere?

No. The check runs in this page. Closing the tab clears it.

See it work

After= alone does not protect a backup: if the NAS mount is missing, the job still starts.
After= alone does not protect a backup: if the NAS mount is missing, the job still starts.
Add RequiresMountsFor= and the backup will not start without its mount, even with nofail.
Add RequiresMountsFor= and the backup will not start without its mount, even with nofail.
Automounts and startup hooks get an honest "check by hand", with the line to look at.
Automounts and startup hooks get an honest "check by hand", with the line to look at.

More pictures, and how Fstab Check works