Converting linear to mirror using lvconvert seems to fail in some cases. Depending on the size of linear lv used and number of stripes, the extents seem to be miscalculated in some cases making the conversion fail when the total number of extents requested is not divisible by stripe count. The failing conversions shown below should work because the size is specified in units (M) and not exact extent count. # pvcreate /dev/sd[bcdefgh]1 Physical volume "/dev/sdb1" successfully created. Physical volume "/dev/sdc1" successfully created. Physical volume "/dev/sdd1" successfully created. Physical volume "/dev/sde1" successfully created. Physical volume "/dev/sdf1" successfully created. Physical volume "/dev/sdg1" successfully created. Physical volume "/dev/sdh1" successfully created. # vgcreate vg /dev/sd[bcdefgh]1 Volume group "vg" successfully created Working conversions: # lvcreate -L 400M -n lv1 vg Logical volume "lv1" created. # lvconvert --type mirror --mirrors 1 --stripes 4 vg/lv1 Using default stripesize 64.00 KiB. Logical volume vg/lv1 being converted. vg/lv1: Converted: 2.00% vg/lv1: Converted: 100.00% ============================= # lvcreate -L 1g -n lv2 vg Logical volume "lv2" created. # lvconvert --type mirror --mirrors 1 --stripes 4 vg/lv2 Using default stripesize 64.00 KiB. Logical volume vg/lv2 being converted. vg/lv2: Converted: 0.39% vg/lv2: Converted: 100.00% ============================= # lvcreate -L 750m -n lv3 vg Rounding up size to full physical extent 752.00 MiB Logical volume "lv3" created. # lvconvert --type mirror --mirrors 1 --stripes 4 vg/lv3 Using default stripesize 64.00 KiB. Logical volume vg/lv3 being converted. vg/lv3: Converted: 0.00% vg/lv3: Converted: 100.00% Failing conversions: # lvcreate -L 500M -n lv vg Logical volume "lv" created. # lvconvert --type mirror --mirrors 1 --stripes 4 vg/lv Using default stripesize 64.00 KiB. Number of extents requested (125) needs to be divisible by 4. Unable to allocate extents for mirror(s). ============================= # lvcreate -L 600m -n lv4 vg Logical volume "lv4" created. # lvconvert --type mirror --mirrors 1 --stripes 4 vg/lv4 Using default stripesize 64.00 KiB. Number of extents requested (150) needs to be divisible by 4. Unable to allocate extents for mirror(s). ============================= # lvcreate -L 1100m -n lv5 vg Logical volume "lv5" created. # lvconvert --type mirror --mirrors 1 --stripes 4 vg/lv5 Using default stripesize 64.00 KiB. Number of extents requested (275) needs to be divisible by 4. Unable to allocate extents for mirror(s). lvm2-2.03.05-2.el8.x86_64
After evaluating this issue, there are no plans to address it further or fix it in an upcoming release. Therefore, it is being closed. If plans change such that this issue will be fixed in an upcoming release, then the bug can be reopened.