Score:0

Insufficient suitable allocatable extents error when performing RAID takeover

fr flag

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.

Jeff Schaller avatar
nf flag
[one previous answer on U&L](https://unix.stackexchange.com/a/726495/117549), in case it helps the post here any.
Score:0
my flag

For the purposes of this description, consider disk to mean a disk, partition or other logical container. Each disk is considered to be the same size, holding a unit of storage (1GB, 1TB, whatever; it doesn't matter).

  • RAID 5 uses three disks for two units of useful storage
  • RAID 0 uses two disks for two units of useful storage
  • RAID 10 uses two disks for one unit of useful storage; typically RAID 10 can be considered as RAID 1 on top of RAID 0 (or v.v.) so you would use four disks for two units of useful storage

Also

  • When you convert from RAID 5 to RAID 0 you have one unit of storage left over (i.e. one disk is spare)
  • When you convert from RAID 0 to RAID 10 you need an additional unit of storage for each unit that you're converting (i.e. two extra disks on top of the two you're currently using)

Consequence: you started with three disks so you're one disk short.

One option might be to see if you can reduce your RAID 0 array down from using two disks to one, but this presupposes your original RAID 5 array is only half full. The other option is to obtain a fourth disk.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.