LVMVDO(7)
โจ LVMVDO โจ
okay bestie, gather round, because this is lvmvdo(7) from the Miscellaneous Information Manual and it's literally about making your storage not waste space. it's giving genius, it's giving magic, and it's way less scary than it sounds. let's go ๐
๐ธ NAME ๐ธ
lvmvdo โ support for Virtual Data Optimizer in LVM. that's the whole vibe. VDO + LVM = besties.
๐ฆ DESCRIPTION ๐ฆ
okay so VDO is software that gives you inline block-level deduplication, compression, and thin provisioning capabilities for primary storage. three icons in one, no cap.
Deduplication is a technique for reducing the consumption of storage resources by eliminating multiple copies of duplicate blocks. like, why store the same block twice when you can just โจpoint at itโจ. Compression takes the individual unique blocks and shrinks them. These reduced blocks are then efficiently packed together into physical blocks. and thin provisioning manages the mapping from logical blocks presented by VDO to where the data has actually been physically stored, and also eliminates any blocks of all zeroes. bye bye zeroes ๐
With deduplication, instead of writing the same data more than once, VDO detects and records each duplicate block as a reference to the original block. VDO maintains a mapping from Logical Block Addresses (LBA) (used by the storage layer above VDO) to physical block addresses (used by the storage layer under VDO). After deduplication, multiple logical block addresses may be mapped to the same physical block address; these are called shared blocks and are reference-counted by the software. (reference-counted = the software keeps a lil tally so nobody deletes something still in use ๐ซถ)
With compression, VDO compresses multiple blocks (or shared blocks) with the fast LZ4 algorithm, and bins them together where possible so that multiple compressed blocks fit within a 4 KB block on the underlying storage. An LBA is mapped to a physical block address and an index within it for the desired compressed data. All compressed blocks are individually reference counted for correctness.
Block sharing and block compression are invisible to applications using the storage, which read and write blocks as they would if VDO were not present. When a shared block is overwritten, a new physical block is allocated for storing the new block data to ensure that other logical block addresses that are mapped to the shared physical block are not modified. (this is the polite thing to do, honestly ๐)
To use VDO with lvm(8), you must install the standard VDO user-space tools vdoformat(8) and the kernel module "dm_vdo" (for older kernels before 6.9, the out-of-tree kernel VDO module "kvdo" is necessary). iykyk.
The kernel module implements fine-grained storage virtualization, thin provisioning, block sharing, compression and memory-efficient duplicate identification. The user-space tools include vdostats(8) for extracting statistics from VDO volumes.
๐ VDO TERMS ๐
get the vocab down first, then everything else slaps:
- VDODataLV โ VDO data LV is a large hidden LV with the
_vdatasuffix. It is created in a VG used by the VDO kernel target to store all data and metadata blocks. - VDOPoolLV โ A VDO pool LV is a pool for virtual VDOLVs. A VDOLV has the size of the used VDODataLV. Only a single VDOLV is currently supported.
- VDOLV โ A VDO LV is a virtual LV created from a VDOPoolLV. Appears blank after creation. (yes bestie, blank. it's a glow-up in progress ๐)
๐ VDO USAGE ๐
The primary methods for using VDO with lvm2:
๐ 1. Create a VDOPoolLV and a VDOLV
Create a VDOPoolLV that will hold VDO data, and a virtual size VDOLV that the user can use. If you do not specify the virtual size, then the VDOLV is created with the maximum size that always fits into data volume even if no deduplication or compression can happen (i.e. it can hold the incompressible content of /dev/urandom). If you do not specify the name of VDOPoolLV, it is taken from the sequence of vpool0, vpool1, ... (auto-naming, we love a self-starter ๐ซ)
Note: The performance of TRIM/Discard operations is slow for large volumes of VDO type. Please try to avoid sending discard requests unless necessary because it might take a considerable amount of time to finish the discard operation. like genuinely, it's slow bestie, don't ๐
lvcreate --type vdo -n VDOLV -L DataSize -V LargeVirtualSize VG/VDOPoolLV
lvcreate --vdo -L DataSize VG
Example
# lvcreate --type vdo -n vdo0 -L 10G -V 100G vg/vdopool0
# mkfs.ext4 -E nodiscard /dev/vg/vdo0
๐ 2. Convert an existing LV into VDOPoolLV
Convert an existing LV into a VDOPoolLV, which is a volume that can hold data and metadata. You will be prompted to confirm such conversion because it IRREVERSIBLY DESTROYS the content of the volume and the volume is immediately formatted by vdoformat(8) as a VDO pool data volume. (emphasis on IRREVERSIBLY, this is not a drill ๐ญ)
You can specify the virtual size of the VDOLV associated with this VDOPoolLV. If you do not specify the virtual size, it will be set to the maximum size that can keep 100% incompressible data in it.
lvconvert --type vdo-pool -n VDOLV -V VirtualSize VG/VDOPoolLV
lvconvert --vdopool VG/VDOPoolLV
Example
# lvconvert --type vdo-pool -n vdo0 -V10G vg/ExistingLV
๐ 3. Change the compression and deduplication of a VDOPoolLV
Disable or enable the compression and deduplication for VDOPoolLV (the volume that maintains all VDO LV(s) associated with it). flip the switches, bestie ๐ฅ
lvchange --compression y|n --deduplication y|n VG/VDOPoolLV
Example
# lvchange --compression n vg/vdopool0
# lvchange --deduplication y vg/vdopool1
๐ 4. Change the default settings used for creating a VDOPoolLV
VDO allows you to set a large variety of options. Lots of these settings can be specified in lvm.conf or profile settings. You can prepare a number of different profiles in the /etc/lvm/profile directory and just specify the profile file name. Check the output of:
lvmconfig --type default --withcomments
for a detailed description of all individual VDO settings. (go read it, it's long but it eats ๐)
Example
# cat <<EOF > /etc/lvm/profile/vdo_create.profile
allocation {
vdo_use_compression=1
vdo_use_deduplication=1
vdo_minimum_io_size=4096
vdo_block_map_cache_size_mb=128
vdo_block_map_period=16380
vdo_use_sparse_index=0
vdo_index_memory_size_mb=256
vdo_slab_size_mb=2048
vdo_ack_threads=1
vdo_bio_threads=1
vdo_bio_rotation=64
vdo_cpu_threads=2
vdo_hash_zone_threads=1
vdo_logical_threads=1
vdo_physical_threads=1
vdo_max_discard=1
}
EOF
# lvcreate --vdo -L10G --metadataprofile vdo_create vg/vdopool0
# lvcreate --vdo -L10G --config 'allocation/vdo_cpu_threads=4' vg/vdopool1
๐ 5. Set or change VDO settings with option --vdosettings
Use the form 'option=value' or 'option1=value option2=value', or repeat --vdosettings for each option being set. Options are listed in the Example section above; for the full description see lvm.conf(5). Options can omit vdo_ and vdo_use_ prefixes and all their underscores. So, for example, vdo_use_deduplication=1 and deduplication=1 are equivalent. (shorthand, we stan an abbreviation queen โจ)
To change an option for an existing VDOPoolLV, use the lvchange(8) command. However, not all options can be changed. For an active VDO LV, only compression and deduplication options can be changed. Lowest priority options are specified in the configuration file, then with --vdosettings. The explicit options --compression and --deduplication have the highest priority. (priority order bestie, respect the hierarchy ๐
)
Example
# lvcreate --vdo -L10G --vdosettings 'ack_threads=1 hash_zone_threads=2' vg/vdopool0
# lvchange --vdosettings 'bio_threads=2 deduplication=1' vg/vdopool0
๐ 6. Checking the usage of VDOPoolLV
To quickly check VDOPoolLV usage, use lvs(8). The Data% field reports both the proportion of the VDOLV's virtual data that is used and the space consumed by data and metadata blocks in the VDOPoolLV. For a detailed description, use the vdostats(8) command. two numbers, one field, so efficient ๐ฆ
Note:vdostats(8)currently understands only/dev/mapperdevice names. (don't come at it with anything else, it will simply not โ)
Example
# lvcreate --type vdo -L10G -V20G -n vdo0 vg/vdopool0
# mkfs.ext4 -E nodiscard /dev/vg/vdo0
# lvs -a vg
LV VG Attr LSize Pool Origin Data%
vdo0 vg vwi-a-v--- 20.00g vdopool0 0.01
vdopool0 vg dwi-ao---- 10.00g 30.16
[vdopool0_vdata] vg Dwi-ao---- 10.00g
# vdostats --all /dev/mapper/vg-vdopool0-vpool
/dev/mapper/vg-vdopool0 :
version : 30
release version : 133524
data blocks used : 79
...
๐ 7. Extending the VDOPoolLV size
You can add more space to hold VDO data and metadata by extending the VDODataLV using the commands lvresize(8) and lvextend(8). The extension needs to add at least one new VDO slab. You can configure the slab size with the allocation/vdo_slab_size_mb setting. slab size = your call ๐
You can also enable automatic size extension of a monitored VDOPoolLV with the activation/vdo_pool_autoextend_percent and activation/vdo_pool_autoextend_threshold settings. set it and forget it, main character energy.
Note: You cannot reduce the size of a VDOPoolLV. one way street, bestie. growing only ๐
lvextend -L+AddingSize VG/VDOPoolLV
Example
# lvextend -L+50G vg/vdopool0
# lvresize -L300G vg/vdopool1
๐ 8. Extending or reducing the VDOLV size
You can extend or reduce a virtual VDO LV as a standard LV with the lvresize(8), lvextend(8), and lvreduce(8) commands. yes bestie, the VDOLV can shrink, unlike its pool parent ๐
Note: Reducing the size requires TRIM operations for the reduced disk area to unmap used data blocks from the VDOPoolLV, which might take a long time. so like, plan a snack break ๐
lvextend -L+AddingSize VG/VDOLV
lvreduce -L-ReducingSize VG/VDOLV
Example
# lvextend -L+50G vg/vdo0
# lvreduce -L-50G vg/vdo1
# lvresize -L200G vg/vdo2
๐ 9. Component activation of a VDODataLV
You can activate a VDODataLV separately as a component LV for examination purposes. The activation of the VDODataLV activates the data LV in read-only mode, and the data LV cannot be modified. If the VDODataLV is active as a component, any upper LV using this volume CANNOT be activated. You have to deactivate the VDODataLV first to continue to use the VDOPoolLV. look but don't touch, literally ๐ซถ
Example
# lvchange -ay vg/vpool0_vdata
# lvchange -an vg/vpool0_vdata
โจ VDO TOPICS โจ
Okay bestie, this is the tea on how to actually flex your VDO setup. We got seven-ish little scenarios, and each one is giving main character energy. Let's go. ๐
1. Stacking VDO ๐ฅ
You can convert or stack a VDOPoolLV with these currently supported volume types: linear, striped, RAID, and cache with a cachepool. That's the whole vibe check. No cap.
1. Using multiple volumes with the same VDOPoolLV ๐ซถ
Okay so you can convert an existing VDO LV into a thin volume. After this conversion you can create a thin snapshot or you can add more thin volumes with thin-pool named after original LV name LV_tpool0. See lvmthin(7) for more details. Iykyk.
Example:
# lvcreate --type vdo -L 5G -V 10G -n vdo1 vg/vdopool
# lvconvert --type thin vg/vdo1
# lvcreate -V20 vg/vdo1_tpool0
2. VDOPoolLV on top of raid ๐ฐ
Using a RAID-type LV for a VDODataLV. Periodt.
Example:
# lvcreate --type raid1 -L 5G -n vdopool vg
# lvconvert --type vdo-pool -V 10G vg/vdopool
3. Caching a VDOPoolLV ๐ง
Caching a VDOPoolLV (a VDODataLV volume name is also accepted) provides a mechanism to accelerate reads and writes of already compressed and deduplicated data blocks together with VDO metadata. It's literally giving speed. ๐ฅ
Example:
# lvcreate --type vdo -L 5G -V 10G -n vdo1 vg/vdopool
# lvcreate --type cache-pool -L 1G -n cachepool vg
# lvconvert --cache --cachepool vg/cachepool vg/vdopool
# lvconvert --uncache vg/vdopool
4. Caching a VDOLV ๐งโจ
Caching a VDO LV improves performance by storing data before it reaches the VDO pool LV layer. The way that data gets a little pre-game. ๐
Example:
# lvcreate --type vdo -L 5G -V 10G -n vdo1 vg/vdopool
# lvcreate --type cache-pool -L 1G -n cachepool vg
# lvconvert --cache --cachepool vg/cachepool vg/vdo1
# lvconvert --uncache vg/vdo1
5. Usage of Discard/TRIM with a VDOLV ๐๏ธ
You can discard data on a VDO LV and reduce used blocks on a VDOPoolLV. However, the current performance of discard operations is still not optimal and takes a considerable amount of time and CPU. Unless you really need it, you should avoid using discard. Not me warning you bestie, it's giving slow. ๐ญ
When a block device is going to be rewritten, its blocks will be automatically reused for new data. Discard is useful when the user knows that the given portion of a VDO LV is not going to be used and the discarded space can be used for block provisioning in other regions of the VDO LV. For the same reason, you should avoid using mkfs with discard for a freshly created VDO LV to save a lot of time that this operation would take otherwise, as the device is already expected to be empty. So lowkey skip it. ๐
6. Memory usage ๐ง
The VDO target requires 38 MiB of RAM and several variable amounts:
1.15 MiBof RAM for each1 MiBof configured block map cache size. The block map cache requires a minimum of150 MiBRAM.1.6 MiBof RAM for each1 TiBof logical space.268 MiBof RAM for each1 TiBof physical storage managed by the volume.
UDS requires a minimum of 250 MiB of RAM, which is also the default amount that deduplication uses. Slay.
The memory required for the UDS index is determined by the index type and the required size of the deduplication window and is controlled by the allocation/vdo_use_sparse_index setting. Keep that in your notes. ๐
With enabled UDS sparse indexing, it relies on the temporal locality of data and attempts to retain only the most relevant index entries in memory and can maintain a deduplication window that is ten times larger than with dense while using the same amount of memory. It's giving efficient. โจ
Although the sparse index provides the greatest coverage, the dense index provides more deduplication advice. For most workloads, given the same amount of memory, the difference in deduplication rates between dense and sparse indexes is negligible. So don't stress too much. ๐ซถ
A dense index with 1 GiB of RAM maintains a 1 TiB deduplication window, while a sparse index with 1 GiB of RAM maintains a 10 TiB deduplication window. In general, 1 GiB is sufficient for 4 TiB of physical space with a dense index and 40 TiB with a sparse index. Numbers don't lie. ๐ฏ
7. Storage space requirements ๐ฆ
You can configure a VDOPoolLV to use up to 256 TiB of physical storage. Only a certain part of the physical storage is usable to store data. This section provides the calculations to determine the usable size of a VDO-managed volume. Math time bestie, but it's cute. ๐งฎ
The VDO target requires storage for two types of VDO metadata and for the UDS index:
- The first type of VDO metadata uses approximately
1 MiBfor each4 GiBof physical storage plus an additional1 MiBper slab. - The second type of VDO metadata consumes approximately
1.25 MiBfor each1 GiBof logical storage, rounded up to the nearest slab. - The amount of storage required for the UDS index depends on the type of index and the amount of RAM allocated to the index. For each
1 GiBof RAM, a dense UDS index uses17 GiBof storage and a sparse UDS index will use170 GiBof storage.
๐ SEE ALSO ๐
lvm(8), lvm.conf(5), lvmconfig(8), lvcreate(8), lvconvert(8), lvchange(8), lvextend(8), lvreduce(8), lvresize(8), lvremove(8), lvs(8), lvmthin(7), vdoformat(8), vdostats(8), mkfs(8)
That's the whole manual page, bestie. Now go forth and be iconic with your LVM VDO setup. ๐๐
And a little credit where it's due: this page comes from Red Hat, Inc. and it's LVM TOOLS 2.03.44(2) dated 2026-10-27, for LVMVDO(7). Obsessed. Periodt. ๐
โจ
๐ฆ where this page comes from
- arch rolling: lvm2 2.03.44-1 ยท GPL-2.0-only AND LGPL-2.1-only
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms