Virtual Data Optimizer (VDO) provides inline block-level deduplication, compression, and thin provisioning for storage. VDO volumes do require more CPU and RAM, especially compression, but in return, they can decrease overall disk usage.
While VDO requires one LV to each PV, using the LVM naming scheme will still provide a meaningful names for VDO volumes in /dev/mapper/.
# install the required packages
yuminstallvdokmod-kvdo
# create the vdo volume# replace 'block_device' with the persistent name of the block device where you want to create the VDO volume. For example, /dev/disk/by-id/scsi-3600508b1001c264ad2af21e903ad031f# if the physical size is over 16TB, check references for the proper slab_sizevdocreate--name=vdo_name--device=block_device--vdoLogicalSize=logical_size[--vdoSlabSize=slab_size]# create the FS# XFS file system (do not attempt to discard blocks)mkfs.xfs-K/dev/mapper/vdo_name
# ext4 file systemmkfs.ext4-Enodiscard/dev/mapper/vdo_name
# mount the volumemkdir-m1777/mnt/vdo_name
mount/dev/mapper/vdo_name/mnt/vdo_name
# update /etc/fstab# if the volume is hosted on network-based block devices, such as iSCSI or NFS, add '_netdev' to the mount options# XFS/dev/mapper/vdo_name/mnt/vdo_namexfsdefaults,x-systemd.device-timeout=0,x-systemd.requires=vdo.service00# ext4/dev/mapper/vdo_name/mnt/vdo_nameext4defaults,x-systemd.device-timeout=0,x-systemd.requires=vdo.service00
Tip: You can place VDO volumes inside an LVM Thin Volume to enable thin provisioning and overallocation, along with the VDO compression and deduplication features.
# install the required packages
dnfinstalllvm2kmod-kvdovdo
# create the vdo volume# replace 'block_device' with the persistent name of the block device where you want to create the VDO volume. For example, /dev/disk/by-id/scsi-3600508b1001c264ad2af21e903ad031f# if the physical size is over 16TB, check references for the proper slab_sizelvcreate--typevdo--namedata_$(hostname-s|tr-d'-')_vg1--sizephysical-size--virtualsizelogical-sizevg_-_name
# create the FS# XFS file system (do not attempt to discard blocks)mkfs.xfs-K/dev/mapper/data_$(hostname-s|tr-d'-')_vg1
# ext4 file systemmkfs.ext4-Enodiscard/dev/mapper/data_$(hostname-s|tr-d'-')_vg1
# mount the volumemkdir-m1777/data
mount/dev/mapper/data_$(hostname-s|tr-d'-')_vg1/data
# update /etc/fstab# if the volume is hosted on network-based block devices, such as iSCSI or NFS, add '_netdev' to the mount options# XFS/dev/mapper/data_$(hostname-s|tr-d'-')_vg1/dataxfsdefaults00# ext4/dev/mapper/data_$(hostname-s|tr-d'-')_vg1/dataext4defaults00```## Monitoring VDO```bash
# view savings
vdostats--human-readable
# verify compression and deduplcation status
lvs-o+vdo_compression,vdo_deduplication
# enable or disable compression and deduplicationlvchange--compression[y|n]vg-name/vdopoolname
lvchange--deduplication[y|n]vg-name/vdopoolname