systemd Mount Unit Builder

Turn a mount point, a device and its options into a .mount unit, with an optional .automount unit for mounting on first access. Nothing is mounted, unmounted or inspected.

Generator only: review both files before installing them in /etc/systemd/system. The file name must match the mount point exactly as systemd escapes it, because a mount unit is identified by its name. Mount units cannot be templated and cannot take extra names through symlinks. Missing mount point directories are created with mode 0755 by default.

Mount

Absolute directory; the unit name is escaped from it.
Shown in systemctl listings.
Device path, UUID=…, LABEL=…, host:/export, or tmpfs.
Type= is optional; omitting it relies on detection.
Comma-separated. x-systemd. options are read only from /etc/fstab and are refused here.

Activation

Written as WantedBy= on the unit that is enabled.
Automount only; for example 5min or 0 to disable.

Generated units

mnt-backup.mount
Install the files in /etc/systemd/system, review them, then reload and enable the unit you want active:sudo systemctl daemon-reload && sudo systemctl enable --now mnt-backup.mount