- Lab
- A Cloud Guru
Working with Systemd Mount Units
Systemd automatically manages mounts for entries that are listed in systemd, and allows you to manually create mount units. In this hands-on lab, you will be tasked with creating systemd mount and automount units.
Path Info
Table of Contents
-
Challenge
Create a unit file for the data mount based on the information provided in the instructions and ensure that it is started and enabled.
- Create a unit file in
/etc/systemd/system
namedmnt-data.mount
with the following contents:
[Unit] Description=Data mount [Mount] What=/dev/disk/by-uuid/filesystem_UUID Where=/mnt/data Type=xfs Options=defaults [Install] WantedBy=multi-user.target
- Update the systemd manager configuration to include a new unit file:
systemctl daemon-reload
- Start and enable the
mnt-data.mount
unit:
systemctl enable mnt-data.mount --now
- Create a unit file in
-
Challenge
Create a unit file for the backup mount based on the information provided in the instructions.
- Create a unit file in
/etc/systemd/system
namedmnt-backup.mount
with the following contents:
[Unit] Description=Backup mount [Mount] What=/dev/disk/by-uuid/filesystem_UUID Where=/mnt/backup Type=ext4 Options=ro [Install] WantedBy=multi-user.target
- Create a mountpoint for
mnt-backup.mount
at/mnt/backup
:
mkdir /mnt/backup
- Update the systemd manager configuration to include a new unit file:
systemctl daemon-reload
- Create a unit file in
-
Challenge
Create an automount unit file for mnt-backup.mount based on the information provided in the instructions and ensure that it is started and enabled.
- Create a unit file in
/etc/systemd/system
namedmnt-backup.automount
with the following contents:
[Unit] Description=Automount backup directory [Automount] Where=/mnt/backup TimeoutIdleSec=600 [Install] WantedBy=multi-user.target
- Update the systemd manager configuration to include new unit file:
systemctl daemon-reload
- Start and enable the
mnt-backup.automount
unit:
systemctl enable mnt-backup.automount --now
- Create a unit file in
What's a lab?
Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.
Provided environment for hands-on practice
We will provide the credentials and environment necessary for you to practice right within your browser.
Guided walkthrough
Follow along with the author’s guided walkthrough and build something new in your provided environment!
Did you know?
On average, you retain 75% more of your learning if you get time for practice.