Home / Linux / How to Create a VDO Volume On a Storage Device on RHEL 8

How to Create a VDO Volume On a Storage Device on RHEL 8

How to Create a VDO Volume On a Storage Device on RHEL 8

Introduced by RedHat in RHEL 7.5 and later, VDO brief for Virtual Date Optimizer is a block virtualization expertise that gives inline deduplication and compression of knowledge at a block machine degree.

The thought of deduplication is sort of easy: to take away copies of duplicate knowledge and solely stay with one copy. When an an identical file is added on a block machine, it’s marked as a duplicate and the unique file is referenced as a substitute. In so doing, VDO helps is saving the block quantity’s area.

In this tutorial, you’ll find out how to create a VDO quantity on a storage machine on the RHEL 8 system.

Step 1: Install the VDO in RHEL 8

To get began, log in to your server and replace your RHEL utilizing the dnf command.

$ sudo dnf replace -y
Update RHEL 8 SystemUpdate RHEL 8 System

Update RHEL 8 System

After the replace of the packages & kernel is full, proceed and set up the VDO kernel modules and dependencies utilizing the command.

$ sudo dnf set up kmod-kvdo vdo
  • vdo – This is a set of Management instruments for Virtual Data Optimizer.
  • kmod-kvdo – This is a group of Kernel Modules for Virtual Data Optimizer.
Install VDO in RHEL 8Install VDO in RHEL 8

Install VDO in RHEL 8

After profitable set up, begin, allow and confirm the vdo daemon.

$ sudo systemctl begin vdo
$ sudo systemctl allow vdo
$ sudo systemctl standing vdo
Verify VDO Service StatusVerify VDO Service Status

Verify VDO Service Status

Step 2: Create a VDO Volume in RHEL 8

Before creating a vdo quantity, guarantee that you’ve a further exhausting drive on your system. In this tutorial, we have now connected a further quantity xvdb . This will be demonstrated by operating the lsblk command under.

$ lsblk
Check New Block DevicesCheck New Block Devices

Check New Block Devices

From the output, you may clearly see that the second disk has a capability of 100GB.

Now, we will create ane empty VDO quantity on /dev/xvdb disk.

$ sudo vdo create --name=vdo1 --device=/dev/xvdb --vdoLogicalSize=300G

You will encounter the error proven.

Module Kvdo Not Found ErrorModule Kvdo Not Found Error

Module Kvdo Not Found Error

This is a frequent bug and the workaround is to merely reboot your server.

$ sudo reboot

On the second trial, the command can be executed, creating an empty VDO quantity on the machine /dev/xvdb.

$ sudo vdo create --name=vdo1 --device=/dev/xvdb --vdoLogicalSize=300G
Create VDO Volume on DiskCreate VDO Volume on Disk

Create VDO Volume on Disk

Let’s break down the command and have a have a look at the choice used:

  • create – This initiates the creation of the VDO quantity.
  • –identify=vdo1 – This provides the quantity a label often known as vdo1. Feel free to assign any identify of your selection.
  • –machine=/dev/xvdb – The machine possibility specifies the disk on which the quantity can be created.
  • –vdoLogicalSize=300G – This signifies the efficient quantity capability to be utilized by the working system, on this case, 300G.

Step three: Probing the New VDO Volume

The new VDO quantity has been created at /dev/mapper/vdo1 going by the output we noticed within the earlier step. We can use the ls command as proven to examine file permissions & possession.

$ ls -l /dev/mapper/vdo1
Check VDO Volume File PermissionsCheck VDO Volume File Permissions

Check VDO Volume File Permissions

To receive extra insightful info use the vdostats command to retrieve statistics on the scale and the utilization of the quantity.

$ vdostats --hu

The --hu flag shows the knowledge in a human-readable format, i.e. a format that’s a lot simpler to learn and decipher with ease. We can view attributes such because the Device identify, the scale on the extra disk, used and accessible area because the % utilization.

Check VDO Volume StatisticsCheck VDO Volume Statistics

Check VDO Volume Statistics

Carefully observe that the % Saving is indicated as Not Applicable (N/A).

Also, be aware that already we have now some quantity utilization four.1G which interprets to four% but we haven’t written something on the quantity. Why is that? This is as a result of the common Deduplication has already been written onto the disk and it’s what makes deduplication doable.

The vdostats command can be utilized with the --verbose flag to retrieve extra detailed info as proven:

$ sudo vdostats --verbose /dev/mapper/vdo1 | grep -B6 ‘saving percent’
Check VDO Volume InformationCheck VDO Volume Information

Check VDO Volume Information

What you may see is principally the identical knowledge because the earlier instance however in a totally different format.

Step four: Partitioning the VDO Volume

After acquiring sufficient insights from the quantity, we’d like to partition it and later create a filesystem in order that it may be used as a regular disk.

Let’s create a bodily quantity and quantity group as proven, run the next instructions.

$ sudo pvcreate /dev/mapper/vdo1
$ sudo vgcreate vdo1vg /dev/mapper/vdo1
Create Physical Volume and Volume Group in VDOCreate Physical Volume and Volume Group in VDO

Create Physical Volume and Volume Group in VDO

To show the statistics of the quantity group run:

$ sudo vgdisplay vdo1vg
Check Statistics of VDO Volume GroupCheck Statistics of VDO Volume Group

Check Statistics of VDO Volume Group

Now, we are going to create 2 equally sized logical volumes every with a capability of 50G.

$ sudo lvcreate -n vdo1v01 -L 50G vdo1vg
$ sudo lvcreate -n vdo1v02 -L 50G vdo1vg
Create Logical Volumes in VDOCreate Logical Volumes in VDO

Create Logical Volumes in VDO

You can later view the stats of the newly created volumes by operating the command.

$ sudo lvs
Check Volumes StatisticsCheck Volumes Statistics

Check Volumes Statistics

Step four: Formatting and Mounting File Systems

Usually, when a filesystem is created, a trim operation is carried out on the machine. This is undesirable within the case of the VDO. When formating utilizing the mkfs command, use the -Ok possibility to instruct the command not to discard blocks through the creation fo the filesystem.

$ sudo mkfs.xfs  -Ok /dev/vdo1vg/vdo1v01
$ sudo mkfs.xfs  -Ok /dev/vdo1vg/vdo1v02

If you’re utilizing EXT$ filesystem, use the “-E nodiscard” Option.

Create the mount factors for mounting the volumes:

$ sudo mkdir /knowledge/v01
$ sudo mkdir /knowledge/v02
Create Mount Points for VolumesCreate Mount Points for Volumes

Create Mount Points for Volumes

Now mount the filesystems onto their mount factors as proven.

$ sudo mount -o discard /dev/vdo1vg/vdo1v01  /knowledge/v01
$ sudo mount -o discard /dev/vdo1vg/vdo1v02  /knowledge/v02
Mount FilesytemsMount Filesytems

Mount Filesytems

Now once you examine the VDO quantity you’ll discover that the % saving has modified to 99% which is sort of spectacular. This implies that deduplication is working as anticipated.

$ sudo vdostats --hu
Check VDO Filesystem StatisticsCheck VDO Filesystem Statistics

Check VDO Filesystem Statistics

You can additional examine utilizing the df -Th command. At the underside part, you’ll see the filesystems mounted on /knowledge/v01 and /knowledge/v02 respectively.

$ df -hT
Check VDO Filesystem SizeCheck VDO Filesystem Size

Check VDO Filesystem Size

In this tutorial, we demonstrated how one can create a VDO quantity from a further storage machine on RHEL 8. We later went forward and demonstrated how one can create extra volumes and create filesystems from these volumes.

About Agent

Check Also

Google Anthos Update Aims at AWS, Puts Azure in Crosshairs

Google Anthos Update Aims at AWS, Puts Azure in Crosshairs Google …

Leave a Reply

Your email address will not be published. Required fields are marked *