This tutorial explains how to configure disk compression using Virtual Data Optimizer in Linux for effective storage management.
In this tutorial, you’ll learn how to configure disk compression using Virtual Data Optimizer (VDO) in Linux. Although storage has become increasingly abundant and affordable, effective storage management remains crucial. VDO optimizes storage use through three key techniques: zero-block filtering, deduplication, and compression. Below, we explain each concept and provide step-by-step instructions to configure VDO on your system.
VDO enhances storage performance by filtering out unnecessary data, eliminating redundant blocks, and compressing data in real time.
VDO begins by scanning the storage device for blocks filled only with zeros—data that does not contribute meaningfully to the stored information. This process is similar to draining water from pasta using a colander: the water (empty data) flows away while the pasta (useful data) is retained.
Once zero blocks are filtered out, VDO moves on to deduplication. In this step, VDO checks if a block of data is already present elsewhere on the storage device. If a duplicate is found, instead of rewriting the data, VDO updates its metadata to reference the existing block. This method reduces redundant data storage and conserves disk space.
The final step in the VDO process is data compression. As data blocks are written to disk, VDO compresses them and packs several compressed blocks into one physical block. This not only saves space but can also improve read performance by reducing the amount of data transferred.
To begin using VDO, you must have a storage device. In this example, we use an unpartitioned device /dev/vdb (5 GB in size) and create a VDO device with a logical size of 10 GB:
vdo create: Initiates the creation of a new VDO-managed device.
--name=vdo_storage: Assigns a name to the new VDO device.
--device=/dev/vdb: Specifies the physical storage device to use.
--vdoLogicalSize=10G: Sets the logical volume size that users will see (10 GB logical, despite a 5 GB physical size).
After creating the VDO device, check its status with:
Copy
Ask AI
sudo vdostats --human-readable
Expected output:
Copy
Ask AI
Device Size Used Available Use% Space saving%/dev/mapper/vdo_storage 5.0G 3.0G 2.0G 60% N/A
Here, the “Size” column reflects the physical capacity while “Use%” indicates current usage. The “Space saving%” field displays N/A until data is written.
Next, create an XFS filesystem on the VDO device. The -K option prevents XFS from sending discard requests, which accelerates filesystem creation on an all-zero VDO device:
Before mounting the VDO device, create a mount point (e.g., /mnt/myvdo) and add an entry to /etc/fstab with the necessary options to ensure the VDO service is active before mounting:
Device Size Used Available Use% Space saving%/dev/mapper/vdo_storage 5.0G 3.1G 1.9G 61% 95%
As you add more identical copies, you will notice an increase in the space-saving percentage, demonstrating VDO’s effective deduplication—even when file names differ.
In RHEL 9, VDO is integrated with LVM, and the standalone Python-based VDO tools are no longer used. To create a new VDO volume using LVM, proceed with the following steps:
One clear advantage of the LVM-integrated approach in RHEL 9 is that it simplifies mounting by eliminating the complex options required in previous versions.
This confirms that the VDO volume has a logical size of 10 GB and is correctly mounted.For more details on LVM-based VDO options, refer to the manual pages:
Copy
Ask AI
man lvm vdo
This concludes our comprehensive guide on configuring disk compression with VDO. Enjoy the benefits of optimized storage and improved performance in your Linux environment!