Configure File Systems by UUID or Label

LinuxLinuxBeginner
Practice Now

Introduction

In this challenge, you will learn how to configure local storage on a Linux system by mounting file systems at boot using Universally Unique Identifier (UUID) or label. This is an essential skill for system administrators to ensure the reliability and consistency of file system mounts, even when the underlying device names change.


Skills Graph

%%%%{init: {'theme':'neutral'}}%%%% flowchart RL linux(("`Linux`")) -.-> linux/BasicSystemCommandsGroup(["`Basic System Commands`"]) linux/BasicSystemCommandsGroup -.-> linux/echo("`Text Display`") subgraph Lab Skills linux/echo -.-> lab-389434{{"`Configure File Systems by UUID or Label`"}} end

Configure File System Mounts by UUID

Tasks

  • Create a new file system on a local storage device
  • Configure the system to mount the file system by UUID at boot

Requirements

  • Create a new file system on the /dev/sdb device
  • Mount the file system to the /mnt/data directory
  • Configure the system to mount the file system by UUID at boot
  • Verify that the file system is mounted correctly after a system reboot

Example

After completing this step, the output of the mount command should show the file system mounted on /mnt/data using the UUID:

/dev/sdb1 on /mnt/data type ext4 (rw,relatime)

Configure File System Mounts by Label

Tasks

  • Create a new file system on a local storage device
  • Configure the system to mount the file system by label at boot

Requirements

  • Create a new file system on the /dev/sdc device
  • Mount the file system to the /mnt/backup directory
  • Configure the system to mount the file system by label at boot
  • Verify that the file system is mounted correctly after a system reboot

Example

After completing this step, the output of the mount command should show the file system mounted on /mnt/backup using the label:

LABEL=backup on /mnt/backup type ext4 (rw,relatime)

Summary

In this challenge, you learned how to configure local storage on a Linux system by mounting file systems at boot using UUID or label. This is an essential skill for system administrators to ensure the reliability and consistency of file system mounts, even when the underlying device names change. You practiced creating new file systems, obtaining their UUIDs and labels, and configuring the /etc/fstab file to mount the file systems by UUID and label. You also learned how to verify the file system mounts after a system reboot.

Other Linux Tutorials you may like