RHCSA Rapid Track
In this exercise, you will create a VDO volume, format it with a file system, mount it, store data on it, and investigate the impact of compression and deduplication on storage space actually used.
Outcomes
You should be able to:
Create a volume using Virtual Data Optimizer, format it with a file-system type, and mount a file system on it.
Investigate the impact of data deduplication and compression on a Virtual Data Optimizer volume.
Log in to workstation as student using student as the password.
On workstation, run lab advstorage-vdo start to start the exercise.
This script ensures that there are no partitions on the /dev/vdd disk and sets up the environment correctly.
[student@workstation ~]$lab advstorage-vdo start
From
workstation, open an SSH session toserveraasstudent.[student@workstation ~]$ssh student@servera...output omitted...[student@servera ~]$Create the VDO volume
vdo1, using the/dev/vdddevice. Set its logical size to 50 GB.Switch to the
rootuser.[student@servera ~]$sudo -i[sudo] password for student:student[root@servera ~]#Confirm that the vdo package is installed using the
yumcommand.[root@servera ~]#yum list installed vdoInstalled Packages vdo.x86_64 6.2.2.117-13.el8 @rhel-8-for-x86_64-baseos-rpmsCreate the
vdo1volume using thevdo createcommand.[root@servera ~]#vdo create --name=vdo1 \--device=/dev/vdd --vdoLogicalSize=50G...output omitted...Verify the availability of the
vdo1volume using thevdo listcommand.[root@servera ~]#vdo listvdo1
Verify that the
vdo1volume has both the compression and deduplication features enabled.Use
grepto search for the lines containing the stringDeduplicationandCompressionin the output of thevdo status --name=vdo1command.[root@servera ~]#vdo status --name=vdo1 \| grep -E 'Deduplication|Compression'Compression: enabled Deduplication: enabledFormat the
vdo1volume with theXFSfile-system type and mount it on/mnt/vdo1.Use the
udevadmcommand to verify that the new VDO device file has been created.[root@servera ~]#udevadm settleFormat the
vdo1volume with theXFSfile system using themkfscommand.[root@servera ~]#mkfs.xfs -K /dev/mapper/vdo1...output omitted...The
-Koption in the precedingmkfs.xfscommand prevents the unused blocks in the file system from being discarded immediately which lets the command return faster.Create the
/mnt/vdo1directory using themkdircommand.[root@servera ~]#mkdir /mnt/vdo1Mount the
vdo1volume on/mnt/vdo1using themountcommand.[root@servera ~]#mount /dev/mapper/vdo1 /mnt/vdo1Verify that the
vdo1volume is successfully mounted using themountcommand.[root@servera ~]#mount...output omitted... /dev/mapper/vdo1 on /mnt/vdo1 type xfs (rw,relatime,seclabel,attr2,inode64,noquota)
Create three copies of the same file named
/root/install.imgon thevdo1volume. Compare the statistics of the volume to verify the data deduplication and compression happening on the volume. The preceding output may vary on your system..View the initial statistics and status of the volume using the
vdostatscommand.[root@servera ~]#vdostats --human-readableDevice Size Used Available Use% Space saving% /dev/mapper/vdo1 5.0G3.0G2.0G 60%99%Notice that 3 GB of the volume is already used because when created, the VDO volume reserves 3-4 GB for itself. Also, note that the value
99%in theSpace saving%field indicates that you have not created any content so far in the volume contributing to all of the saved volume space.Copy
/root/install.imgto/mnt/vdo1/install.img.1and verify the statistics of the volume. It may take up to a minute to copy the file.[root@servera ~]#cp /root/install.img /mnt/vdo1/install.img.1[root@servera ~]#vdostats --human-readableDevice Size Used Available Use% Space saving% /dev/mapper/vdo1 5.0G3.4G1.6G 68%5%Notice that the value of the
Usedfield increased from3.0Gto3.4Gbecause you copied a file to the volume, and that occupies some space. Also, notice that the value ofSpace saving%field decreased from99%to5%because initially there was no content in the volume, contributing to the low volume space utilization and high volume space saving until you created a file. The volume space saving is considerably low because you created a unique copy of the file in the volume and there is nothing to deduplicate.Copy
/root/install.imgto/mnt/vdo1/install.img.2and verify the statistics of the volume. It may take up to a minute to copy the file.[root@servera ~]#cp /root/install.img /mnt/vdo1/install.img.2[root@servera ~]#vdostats --human-readableDevice Size Used Available Use% Space saving% /dev/mapper/vdo1 5.0G3.4G1.6G 68%51%Notice that the used volume space did not change rather the percentage of the saved volume space increased proving that the data deduplication occurred to reduce the space consumption for the redundant copies of the same file. The value of
Space saving%in the preceding output may vary on your system.Exit the
rootuser's shell and log out ofservera.[root@servera ~]#exitlogout[student@servera ~]$exitlogout Connection to servera closed.[student@workstation ~]$