Skip to content

Creating VDO Volumes for Inline Block-Level Deduplication and Compression⚓︎

Overview⚓︎

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/.

Process⚓︎

RHEL7 Based Systems⚓︎

Bash
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# install the required packages
yum install vdo kmod-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_size
  vdo create --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 system
  mkfs.ext4 -E nodiscard /dev/mapper/vdo_name

# mount the volume
  mkdir -m 1777 /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_name xfs defaults,x-systemd.device-timeout=0,x-systemd.requires=vdo.service 0 0
    # ext4
    /dev/mapper/vdo_name /mnt/vdo_name ext4 defaults,x-systemd.device-timeout=0,x-systemd.requires=vdo.service 0 0

RHEL8 Based Systems⚓︎

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.

Bash
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# install the required packages
dnf install lvm2 kmod-kvdo vdo

# 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_size
  lvcreate --type vdo --name data_$(hostname -s | tr -d '-')_vg1 --size physical-size --virtualsize logical-size vg_-_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 system
  mkfs.ext4 -E nodiscard /dev/mapper/data_$(hostname -s | tr -d '-')_vg1

# mount the volume
  mkdir -m 1777 /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 /data xfs defaults 0 0
    # ext4
    /dev/mapper/data_$(hostname -s | tr -d '-')_vg1 /data ext4 defaults  0 0
  ```

## Monitoring VDO

```bash
# view savings
vdostats --human-readable

# verify compression and deduplcation status
lvs -o+vdo_compression,vdo_deduplication

# enable or disable compression and deduplication
  lvchange --compression [y|n]  vg-name/vdopoolname
  lvchange --deduplication [y|n] vg-name/vdopoolname

References⚓︎