I have a striped logical volume that is currently split between two physical drives (/dev/sda1
and /dev/sdb1
). I now want to mirror this volume onto a third device (/dev/sdc1
) that has been added into the volume group. A number of references I have found (e.g. Is it possible to convert striped logical volume to linear logical volume?) suggest this is possible with the following command:
lvconvert -m 1 /dev/volgroup/volume /dev/sdc1
However for me this results in the following error:
'--mirrors/-m' is not compatible with striped
Why isn't this working for me?
LVM version
LVM version: 2.02.133(2) (2015-10-30)
Library version: 1.02.110 (2015-10-30)
Driver version: 4.34.0
Best Answer
Try it like this
Below is the command log of my test. I did it on loopback devices
Create 3 loopback devices
Create PVs
Create VG and LV with 2 stripes
Format and mount
Now let's add our 3rd PV to VG
And now convert
Remove striped part from mirror
And now get rid of the /dev/loop0 and /dev/loop1
So what we have finally is this
Edit 1:
What I described above works on CentOS 6, but doesn't work on CentOS 7.
I guess in CentOS 7 this rule kicks in.
Since striped != linear, it fails.
I just recompiled lvm rpm package from source but added extra debug
And here is output
So basically all 3 conditions evaluate to true and we enter error handling block.
Edit 2:
I found solution for CentOS 7. Instead of RAID 1 - we need to use --type mirror
And then convert it to Linear and chose which PVs to remove