Mounting partitions with systemd

Example systemd mount unit:

[Unit]
Description = Backup logical volume
After = lvm2-monitor.service

[Mount]
What = UUID="a37505f4-46e7-4496-8926-deadbeef4a79"
#What = "/dev/vg_backup/lv_backup"
Where = /mnt/backup
Type = xfs
Options = nodev,nosuid,noexec

[Install]
WantedBy = multi-user.target

Note that the unit file name needs to match the Where = clause. This unit needs to be named mnt-backup.mount, and goes in /etc/systemd/system/.

Advertisements
Mounting partitions with systemd