Create a systemd mount unit for /data/backup.
Derive the unit filename from the mount-point path.
Which filename is appropriate?
systemd escapes the absolute mount path and appends .mount. The path /data/backup maps to data-backup.mount.
Detailed explanation
data/backup.mountIncorrect. A leading slash is not retained as data/ in the unit filename.
Incorrect. A leading slash is not retained as data/ in the unit filename.
mount-data-backup.serviceIncorrect. This is not the systemd mount-unit naming convention.
Incorrect. This is not the systemd mount-unit naming convention.
backup.data.mountIncorrect. The components are in the wrong order.
Incorrect. The components are in the wrong order.
data-backup.mountCorrect. /data/backup maps to data-backup.mount.
Correct. /data/backup maps to data-backup.mount.
Try it yourself
An example you can run in a temporary verification environment.
systemd-escape --path --suffix=mount /data/backupExpected result
data-backup.mountKey points
- The unit name represents the path
- Slashes become separators in the escaped name
- The suffix is .mount
Notes
- Environment: systemd 255
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Read the scope first
Check whether the command acts on the current shell, a new process, an existing process, or a file.
Verify the observable result
Use the supplied command and compare the output with the expected result.