From the course: Exploring Linux Internals: Advanced Insights and Practical Applications
LVM and VDO - Linux Tutorial
From the course: Exploring Linux Internals: Advanced Insights and Practical Applications
LVM and VDO
- In this video, I'd like to tell you about LVM and VDO. So Virtual Data Optimizer or VDO provides thin provisioning on top of LVM logical volumes by using data deduplication and compression. If you have known VDO in Red Hat Enterprise Linux 8, you should know that since it has been integrated in LVM, and the standalone option that works without LVM is no longer available. So in this setup, you should realize that LVM also provides thin provisioning, but VDO provides more efficient algorithms, and for that reason, it has been integrated in LVM By using VDO on top of LVM, it's easy to increase the size of the underlying volumes while running out of physical storage. And while creating VDO logical volumes, you must realize that the minimal size of 5 gigabytes is required. That's because it's quite heavy on the metadata. You don't have the 5 gigabytes, it's not going to work. Also, while creating a file system on top of a VDO logical volume, you must use the nodiscard option. This nodiscard option makes sure that it handles the thin provision storage pretty well. So mkfs.ext4 -E nodiscard, followed by the rest of the options, or mkfs -K, followed by anything else that you want to use while creating the storage. All right, so let me make a drawing to make clear how you work with VDO is integrated in LVM, because overall there's a lot of layers that is involved. Well, let me give you an overview of all of these layers. It all starts with the VDO pool. And this VDO pool is where you are creating your volumes from. Now this VDO pool sits on top of LVM. And that means that the VDO pool can be created on top of an LVM logical volume. And this LVM logical volume, of course, is based on the LVM volume group. And what do we have in the LVM volume group? Well, we have the lower layers. And the lower layers of course is your pvs, your physical volumes. And to make it even more confusing, these pvs, as you remember, that can be complete hard disks, or partitions, or even logical partitions. So you have a logical partition that you put in a volume group to create a logical volume to put a VDO pool on top of the logical volume to create your VDO volume on top of that. Wow, complicated. But it's the way how VDO is working. Let's check out how to create this stuff. Alright, so let me show you how to work with VDO. In order to follow this demo, you need 10 gigabyte LVM type partition. So let's create a partition, before we do anything else. Once again, lsblk, and we are going to use sdc. So fdisk on /dev/sdc, using n for new, and P for primary and partition number 1 and first sector, and I make it 10 gigabytes. Next, I need to set the type to LVM. Did you ever notice that recently fdisk has introduced the option to work with an alias before you needed to specify the type as 8e, and now you can just type LVM. Kind of cool. P is showing that we now have sdc1, and sdc1 is what we are going to use. So I'm saving it. And I am going to use vgcreate vgstorage /dev/sdc1. And next I can use lvcreate - -type vdo - L 5G. That's a minimal size for your VDO volumes. - V 100 G. That is the thin commission size. And next, I'm using vgstorage/vdopool0. And, oh boy, what do we see? We see that modprobe failed with vdo required device-mapper target not detected in your kernel. Well, I think I know what is going wrong here. Let's do a dnf search on vdo. VDO requires a kernel module. And there we can see kmod-kvdo and vdo-support. I want both of them. So dnf installed -y kmod-kvdo, as well as vdo-support. And as you can see here, it is installing a couple of things including kernel core and kernel modules. So we really need to do an update at the kernel level, otherwise it's not going to work. And then we are going to try it again. All right, now that we have installed the required kernel modules, let's use the command again. Okay, so where does this problem come from? Well, we just updated the kernel, and it's always smart to do a quick reboot and try again. Okay, now that we are back on the system, let's create it again. And as you can see, the reboot has helped. So we now have the VDO volume, and the VDO volume is available, so we should start using it. And how are we going to do that? Well, I created a VDO volume, and what is the name of the VDO volume? Well, as you can see, lvol0 on the lowest line. So that's what we are going to format, mkfs -E nodiscard. Hey, shall we make this mkfs.ext4, otherwise you get ext2. You don't want to have ext2, right? On /dev/vgstorage/lvol0. I'm going to mount my /dev/vgstorage/lvol0. Let's mount it temporary on /mnt. So now I'm going to use df -h, and grep it on lvol0. And what do we see? Well, we see 98 gigabytes in total, 98 gigabytes available. That's what VDO is doing, thin provisioning. It's actually using 5 gigabytes, but it's lying and presenting 98 gigabytes to be available. And that's what you would use a VDO for.
Contents
-
-
-
-
-
-
-
-
(Locked)
Module 2: Storage and filesystems introduction22s
-
(Locked)
Learning objectives1m 9s
-
(Locked)
Linux storage devices4m 29s
-
(Locked)
Partitions: MBR and GPT9m 53s
-
(Locked)
Managing partitions13m 58s
-
(Locked)
Images and ISO files2m 57s
-
(Locked)
Understanding flexible storage solutions1m 4s
-
(Locked)
Managing LVM logical volumes4m 35s
-
(Locked)
Using LVM features11m 32s
-
(Locked)
Device mapper4m 49s
-
(Locked)
Manually creating device mapper storage6m 3s
-
LVM and VDO7m 14s
-
(Locked)
Stratis8m 50s
-
(Locked)
Creating encrypted devices9m 20s
-
(Locked)
Booting from encrypted devices4m 53s
-
(Locked)
Real-world scenario: Creating a hidden storage device5m 23s
-
(Locked)
-
-
-
-
-
-
-
-
-