To improve performance while still keeping redundancy, I am trying to convert the root file system of a NAS from a RAID 5 logical volume to a RAID 10 logical volume, while keeping the same number of disks used.
In this section of the lvmraid
man page, it suggests converting RAID 10 and RAID 5 is possible with an indirect conversion.
The following takeover conversions are currently possible:
...
- between striped/raid0 and raid5.
...
- between striped/raid0 and raid10.
But when running the appropriate lvconvert
command (on a similar test
LV), repeatedly as prompted to perform the intermediate conversions, I get this error in the last step when finally converting from RAID 0 to RAID 10:
root@nas:~# lvcreate --type raid5 -i 3 -n test -L 100M vg
Using default stripesize 64.00 KiB.
Rounding size 100.00 MiB (25 extents) up to stripe boundary size 108.00 MiB (27 extents).
Logical volume "test" created.
root@nas:~# lvconvert vg/test --type raid10 -m 1 -i 2
Using default stripesize 64.00 KiB.
Replaced LV type raid10 (same as raid10_near) with possible type raid5_n.
Repeat this command to convert to raid10 after an interim conversion has finished.
Converting raid5 (same as raid5_ls) LV vg/test to raid5_n.
Are you sure you want to convert raid5 LV vg/test? [y/n]: y
Logical volume vg/test successfully converted.
root@nas:~# lvconvert vg/test --type raid10 -m 1 -i 2
Using default stripesize 64.00 KiB.
Replaced LV type raid10 (same as raid10_near) with possible type raid0_meta.
Repeat this command to convert to raid10 after an interim conversion has finished.
Are you sure you want to convert raid5_n LV vg/test to raid0_meta type? [y/n]: y
Logical volume vg/test successfully converted.
root@nas:~# lvconvert vg/test --type raid10 -m 1 -i 2
Using default stripesize 64.00 KiB.
Are you sure you want to convert raid0_meta LV vg/test to raid10 type? [y/n]: y
Insufficient suitable allocatable extents for logical volume : 30 more required
root@nas:~#
Even when freeing up physical extents and reducing the LV size, I get the same error. All the physical volumes are allocatable.
Here is the vgdisplay
output:
--- Volume group ---
VG Name vg
System ID
Format lvm2
Metadata Areas 4
Metadata Sequence No 333
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 3
Open LV 2
Max PV 0
Cur PV 4
Act PV 4
VG Size <3.64 TiB
PE Size 4.00 MiB
Total PE 953864
Alloc PE / Size 943654 / <3.60 TiB
Free PE / Size 10210 / 39.88 GiB
VG UUID PF08Ce-xvsS-7KsA-0Vw6-zkXR-jyUf-ocDWDW
How do I resolve this error? I would like to use the same PEs for the converted LV, shrinking the file system as necessary.