What is an VDO index
VDO uses a high-performance deduplication index called UDS to detect duplicate blocks of data as they are being stored. There are 2 types of UDS indexes available, namely:
- Sparse UDS index – In general, Red Hat recommends using a sparse UDS index for all production use cases. This is an extremely efficient indexing data structure, requiring approximately one-tenth of a byte of DRAM per block in its deduplication window.
- Dense UDS index – The default configuration of the index, however, is to use a dense index. This index is considerably less efficient (by a factor of 10) in DRAM, but it has much lower (also by a factor of 10) minimum required disk space, making it more convenient for evaluation in constrained environments.
Recreating VDO index
The index is not required for the volume to be read-write, though if the index is not online new blocks will not be deduplicated. In certain conditions, It is possible that the index can be corrupted or fail to start and the only way to correct this problem is to create a new index.
Follow the steps outlined below to recreate a VDO index:
Identify whether the index is online. Check output of the following command:
# vdo status --name=[vdo volume name] | grep "index status"
# vdo status --name=vdo1 | grep -i "index status" Index status: offline
Or, check the sysfs output, using the following command:
# cat /sys/kvdo/[vdo volume name] /dedupe/status
# cat /sys/kvdo/vdo1/dedupe/status Offline
Check the logs for uds messages regarding the index using the following command:
# journalctl |egrep -i 'uds|index'
Some possible messages might look like this:
failed to start index, index corrupted unexpected index page map update index could not be loaded UDS Error: Index data in memory is corrupt CRITICAL index_0: could not find block
If running “vdo status” or “vdostats –verbose” results in the following messages in the kernel log:
kernel: uds: vdostats: getBaseContext() failed.: UDS Error: Could not find the requested library context (1028) kernel: kvdo0:vdostats: Error reading index stats: UDS Error: Could not find the requested library context (1028) kernel: uds: vdostats: getBaseContext() failed: UDS Error: Could not find the requested library context (1028) kernel: kvdo0:vdostats: Error reading context stats: UDS Error: Could not find the requested library context (1028)
This is an indication that the UDS index for this VDO volume is offline, despite the output of vdo status saying Index status: online. This test will help in cases where the log events from the time of the original offlining of the index have been rotated out of the current set of system logs.
Create the index using the following command:
# dmsetup message [vdo volume name] [sector] index-create
# dmsetup message vdo1 0 index-create
NOTE: Sector will always be zero and is not used by VDO, but it is required by dmsetup.
How to Resize (Increase) Logical Size of a VDO (Virtual Data Optimizer) volume in CentOS/RHEL