Assign Physical Volumes to Volume Groups

Red Hat Enterprise LinuxBeginner
Practice Now

Introduction

In this challenge, you will learn how to configure local storage by assigning physical volumes to a volume group. This is a fundamental skill for managing Logical Volume Management (LVM) on a Linux system and a common task in the RHCSA exam.

Assign Physical Volumes to a Volume Group

Logical Volume Management (LVM) provides a flexible way to manage disk space. The first step in using LVM is to initialize physical storage devices, known as Physical Volumes (PVs), and then group them into a Volume Group (VG). This challenge focuses on these initial steps.

Tasks

  • Initialize two block devices as LVM physical volumes.
  • Create a new volume group and add the two newly created physical volumes to it.

Requirements

  • The physical volumes must be created on the /dev/vdb1 and /dev/vdb2 devices.
  • The new volume group must be named vg_data.
  • Use sudo to run commands that require root privileges.

Example

After you have successfully completed the tasks, running the sudo pvs and sudo vgs commands should produce output similar to the following. The exact sizes may vary slightly.

$ sudo pvs
  PV         VG      Fmt  Attr PSize      PFree
  /dev/vdb1  vg_data lvm2 a--    1024.00m   1024.00m
  /dev/vdb2  vg_data lvm2 a--    1024.00m   1024.00m

$ sudo vgs
  VG      #PV #LV #SN Attr   VSize  VFree
  vg_data   2   0   0 wz--n-  1.99g  1.99g

Summary

In this challenge, you have learned how to initialize block devices as LVM physical volumes and how to aggregate them into a volume group. These are the foundational steps for implementing a flexible storage solution with LVM on a RHEL system. By completing this challenge, you have gained practical experience that is crucial for advanced storage management tasks.

✨ Check Solution and Practice