3.4. Creating and mounting an LVM-VDO volume
You can create a VDO logical volume (LV) on a VDO pool LV by using the lvcreate command.
Choose a name for your LVM-VDO, such as vdo1. You must use a different name and device for each LVM-VDO on the system.
Prerequisites
- Install the VDO software. For more information, see Installing VDO.
- An LVM volume group with free storage capacity exists on your system.
Procedure
Create the LVM-VDO:
# lvcreate --type vdo \ --name vdo1 \ --size 1T \ --virtualsize 10T \ <vg_name>Replace
1Twith the physical size. If the physical size is larger than 16 TiB, add the following option to increase the slab size on the volume to 32 GiB:--vdosettings 'vdo_slab_size_mb=32768'If you use the default slab size of 2 GiB on a physical size larger than 16 TiB, the
lvcreatecommand fails with the following error:ERROR - vdoformat: formatVDO failed on '/dev/<device>': VDO Status: Exceeds maximum number of slabs supportedReplace
10Twith the logical storage that the LVM-VDO will present.Replace
<vg_name>with the name of an existing LVM volume group where you want to place the LVM-VDO.重要If creating the LVM-VDO volume fails, use
lvremove <vg_name>to remove the volume. Depending on the reason of the failure, you might also need to add two force options (-ff).Create a file system on the LVM-VDO:
For the XFS file system:
# mkfs.xfs -K /dev/<vg_name>/<vdo_name>For the ext4 file system:
# mkfs.ext4 -E nodiscard /dev/<vg_name>/<vdo_name>
Mount the file system on the LVM-VDO volume:
To mount the file system persistently, add the following line to the
/etc/fstabfile:/dev/<vg_name>/<vdo_name> <mount_point> <file_system_type> defaults 0 0Replace
<file_system_type>with your file system, such asxfsorext4.To mount the file system manually, use the
mountcommand:# mount /dev/<vg_name>/<vdo_name> <mount_point>If the LVM-VDO volume is located on a block device that requires network, such as iSCSI, add the
_netdevmount option. For iSCSI and other block devices requiring network, see thesystemd.mount(5)man page for information about the_netdevmount option.
Verification
Verify that an LVM-VDO volume is created:
# lvs