6.10. Converting a Linear device to a RAID logical volume
You can convert an existing linear logical volume to a RAID logical volume. To perform this operation, use the --type argument of the lvconvert command.
RAID logical volumes are composed of metadata and data subvolume pairs. When you convert a linear device to a RAID1 array, it creates a new metadata subvolume and associates it with the original logical volume on one of the same physical volumes that the linear volume is on. The additional images are added in a metadata/data subvolume pair. If the metadata image that pairs with the original logical volume cannot be placed on the same physical volume, the lvconvert fails.
Procédure
View the logical volume device that needs to be converted:
lvs -a -o name,copy_percent,devices my_vg
# lvs -a -o name,copy_percent,devices my_vg LV Copy% Devices my_lv /dev/sde1(0)Copy to Clipboard Copied! Toggle word wrap Toggle overflow Convert the linear logical volume to a RAID device. The following command converts the linear logical volume my_lv in volume group __my_vg, to a 2-way RAID1 array:
lvconvert --type raid1 -m 1 my_vg/my_lv
# lvconvert --type raid1 -m 1 my_vg/my_lv Are you sure you want to convert linear LV my_vg/my_lv to raid1 with 2 images enhancing resilience? [y/n]: y Logical volume my_vg/my_lv successfully converted.Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Vérification
Ensure if the logical volume is converted to a RAID device:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow