Skip to main content

Working with Essential Red Hat Linux System Administration Tools – Storage (VDO)

Hands-On Lab

 

Photo of Rob Marti

Rob Marti

Linux Training Architect I in Content

Length

00:15:00

Difficulty

Intermediate

This lab will present us with a scenario that will make sure we have the minimum knowledge required for successfully passing the RHCE on RHEL8. In this particular lab, we'll be looking at Red Hat storage methods, and making sure we've got skills at the level expected of someone taking this exam.

What are Hands-On Labs?

Hands-On Labs are scenario-based learning environments where learners can practice without consequences. Don't compromise a system or waste money on expensive downloads. Practice real-world skills without the real-world risk, no assembly required.

Working with Essential Red Hat Linux System Administration Tools - Storage (VDO)

Introduction

This lab will present us with a scenario that will make sure we have the minimum knowledge required for successfully passing the RHCE on RHEL8. In this particular lab, we'll be looking at Red Hat storage methods, and making sure we've got skills at the level expected of someone taking this exam.

The Scenario

We've been handed the credentials to a server and told that we have to stand it up today in order to begin the software setup. But additional disks have yet to arrive. While our boss calls the hardware vendor, we've been tasked to set the server up so that it has 150GB of storage, using a sparse deduplication method. Due to circumstances beyond our control, we have to use a local copy of the VDO kmod RPM file. It is located in /home/cloud_user.

Once the device has been created using /dev/xvdf and /dev/xvdj, we have to format it using XFS and mount it at /mnt/video.

Logging In

Use the credentials provided on the hands-on lab page to get into Server1 to begin with. Since we need root privileges, let's just run sudo -i right off and become root.

Ascertain What We Have Available

Before we can do much about setting things up, let's see what we're working with, at least as far as drives and storage go:

fdisk -l

We'll see that there are three disks. One has a couple of partitions on it, and is where our OS is installed. Then there are two empty and unpartitioned drives.

Create the Underlying Device

To set up VDO we first need to install the software, using a local rpm file for the kmod install:

yum install vdo /home/cloud_user/kmod-kvdo-6.2.0.293-50.el8.x86_64.rpm -y

Once that's done, we need to create a single logical volume containing the two physical disks, since VDO can't span disks. First we'll create the physical volumes:

pvcreate /dev/nvme1n1 /dev/nvme2n1

Next we'll create the volume group:

vgcreate vdoDev /dev/nvme1n1 /dev/nvme2n1

Finally, we'll create the logical volume:

lvcreate -n vdoLV -l 100%FREE vdoDev

Now we have a single 40G device that we can set VDO up with. To create the VDO device, run this:

vdo create --name=RHCE --device=/dev/vdoDev/vdoLV --vdoLogicalSize=150G --sparseIndex=enabled

Create a File System on the Device

Now that our storage device is ready, we can put a file system on it (XFS in this case):

mkfs.xfs /dev/mapper/RHCE

Mount the Device

We've been asked to mount this in /mnt/video. We'll create it:

mkdir /mnt/video

Now we can do the actual mounting:

mount /dev/mapper/RHCE /mnt/video

If no errors pop up, we should be good to go.And we're done!

Conclusion

Just to make sure, we can run df -h, which will show us our new volume mounted up in /mnt/video. Congratulations!