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.Documentation Index
Fetch the complete documentation index at: https://notes.kodekloud.com/llms.txt
Use this file to discover all available pages before exploring further.
VDO enhances storage performance by filtering out unnecessary data, eliminating redundant blocks, and compressing data in real time.
Zero-Block Filtering
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.

Deduplication
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.
Compression
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.Installing and Enabling VDO
If VDO is not already installed, you can add it using YUM. Once installed, enable and start the VDO service with systemctl:Creating a VDO Device
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).
Creating a Filesystem on the VDO Device
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:
Mounting the 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:
Demonstrating Deduplication
To observe how VDO conserves disk space via deduplication, follow these steps:-
Create a 50 MB file with random data:
-
Create 10 directories on the VDO mount point:
-
Copy the file into each directory using a loop:
-
Verify the mount point’s usage:
Expected result:
-
Check the VDO statistics:
Expected output:
VDO in RHEL 9 with LVM Integration
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:-
Create a physical volume on
/dev/vdb: -
Create a volume group named
vdo_volume: -
Create a logical volume with VDO options:
-
Create an XFS filesystem on the new VDO volume:
Alternatively, to use an ext4 filesystem:
Mounting the LVM-Based VDO Device
First, create a mount point:/etc/fstab file with your preferred text editor (e.g., vi) and add the following line: