Skip to content

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.
  • Labs icon Lab
  • A Cloud Guru
Google Cloud Platform icon
Labs

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.

Google Cloud Platform icon
Labs

Path Info

Level
Clock icon Intermediate
Duration
Clock icon 30m
Published
Clock icon Jun 19, 2020

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.

Table of Contents

  1. 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.

    1. Create a unit file in /etc/systemd/system named mnt-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
    
    1. Update the systemd manager configuration to include a new unit file:

    systemctl daemon-reload

    1. Start and enable the mnt-data.mount unit:

    systemctl enable mnt-data.mount --now

  2. Challenge

    Create a unit file for the backup mount based on the information provided in the instructions.

    1. Create a unit file in /etc/systemd/system named mnt-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
    
    1. Create a mountpoint for mnt-backup.mount at /mnt/backup:

    mkdir /mnt/backup

    1. Update the systemd manager configuration to include a new unit file:

    systemctl daemon-reload

  3. 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.

    1. Create a unit file in /etc/systemd/system named mnt-backup.automount with the following contents:
    [Unit]
    Description=Automount backup directory
    
    [Automount]
    Where=/mnt/backup
    TimeoutIdleSec=600
    
    [Install]
    WantedBy=multi-user.target
    
    1. Update the systemd manager configuration to include new unit file:

    systemctl daemon-reload

    1. Start and enable the mnt-backup.automount unit:

    systemctl enable mnt-backup.automount --now

The Cloud Content team comprises subject matter experts hyper focused on services offered by the leading cloud vendors (AWS, GCP, and Azure), as well as cloud-related technologies such as Linux and DevOps. The team is thrilled to share their knowledge to help you build modern tech solutions from the ground up, secure and optimize your environments, and so much more!

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.

Start learning by doing today

View Plans