I had two 1T HDD and a 500GB RAID1 LVM LV across them. Then I added another 2T HDD, and converted the LV to RAID5 using
pvcreate /dev/sdd
vgextend ubuntu-vg /dev/sdd
lvconvert --type raid5 --stripes 2 ubuntu-vg/ubuntu-lv
But now, when I list all LVs, there are two SubLVs, with the same name, on the same PV:
# lvs -a -o name,segtype,devices,size,path
LV Type Devices LSize Path
btest linear /dev/sdb(128002) 10.00g /dev/ubuntu-vg/btest
ctest linear /dev/sdc(128002) 10.00g /dev/ubuntu-vg/ctest
dtest linear /dev/sdd(128002) 10.00g /dev/ubuntu-vg/dtest
ubuntu-lv raid5 ubuntu-lv_rimage_0(0),ubuntu-lv_rimage_1(0),ubuntu-lv_rimage_2(0) 1000.00g /dev/ubuntu-vg/ubuntu-lv
[ubuntu-lv_rimage_0] linear /dev/sdb(128001) 500.00g
[ubuntu-lv_rimage_0] linear /dev/sdb(1) 500.00g
[ubuntu-lv_rimage_1] linear /dev/sdc(128001) 500.00g
[ubuntu-lv_rimage_1] linear /dev/sdc(1) 500.00g
[ubuntu-lv_rimage_2] linear /dev/sdd(128001) 500.00g
[ubuntu-lv_rimage_2] linear /dev/sdd(1) 500.00g
[ubuntu-lv_rmeta_0] linear /dev/sdb(0) 4.00m
[ubuntu-lv_rmeta_1] linear /dev/sdc(0) 4.00m
[ubuntu-lv_rmeta_2] linear /dev/sdd(0) 4.00m
([b-d]test
was created after the conversion to test read/write speed on individual HDDs)
For example /dev/sdb(1)
and /dev/sdb(128001)
are both named ubuntu-lv_rimage_0
and having 500G of size, but pvs
shows only 500G allocated on /dev/sdb
:
# pvs
PV VG Fmt Attr PSize PFree
/dev/sdb ubuntu-vg lvm2 a-- 931.51g <421.51g
/dev/sdc ubuntu-vg lvm2 a-- 931.51g <421.51g
/dev/sdd ubuntu-vg lvm2 a-- <1.82t 1.32t
Is it normal? If not, how can I correct it?
EDIT: I think they are two segments of one LV, it's only the output format of lvs
a little confusing. The second segment is created for converting RAID1 to RAID5. How can I delete it?
# lvs -a -o name,seg_pe_ranges ubuntu-vg/ubuntu-lv_rimage_0
LV PE Ranges
[ubuntu-lv_rimage_0] /dev/sdb:128001-128001
[ubuntu-lv_rimage_0] /dev/sdb:1-127999