I have three PVs in PV london. There is one LV in london that only has extents on two (/dev/sda and /dev/sdc) of the three PVs. Additionally, those same PVs have no extents present from any other LVs. I am trying to use vgsplit to remove /dev/sda and /dev/sdc into an new volume group (munich), leaving only one pv (/dev/sdb3) remaining in london. vgsplit refuses to do this and spits out an error message claiming that "Physical volume /dev/sda not in volume group london." In fact, /dev/sda is in volume group london. As a result, I am unable to split the volume group. Here is a transcript with the necessary details: joey@saluki ~ $ sudo pvs PV VG Fmt Attr PSize PFree /dev/md/saluki:r10_0 bayeux lvm2 a- 40.00G 3.50G /dev/md/saluki:r5_0 bayeux lvm2 a- 360.00G 7.00G /dev/sda london lvm2 a- 232.83G 21.83G /dev/sdb3 london lvm2 a- 277.41G 19.03G /dev/sdc london lvm2 a- 279.48G 0 /dev/sdd6 bayeux lvm2 a- 150.00G 37.91G /dev/sde6 bayeux lvm2 a- 150.00G 38.09G /dev/sde7 bayeux lvm2 a- 150.00G 39.41G joey@saluki ~ $ sudo vgsplit --verbose --debug --name mytharc london munich Checking for volume group "london" Checking for new volume group "munich" Wiping cache of LVM-capable devices Archiving volume group "london" metadata (seqno 185). Physical volume /dev/sda not in volume group london joey@saluki ~ $ sudo pvs PV VG Fmt Attr PSize PFree /dev/md/saluki:r10_0 bayeux lvm2 a- 40.00G 3.50G /dev/md/saluki:r5_0 bayeux lvm2 a- 360.00G 7.00G /dev/sda london lvm2 a- 232.83G 21.83G /dev/sdb3 london lvm2 a- 277.41G 19.03G /dev/sdc london lvm2 a- 279.48G 0 /dev/sdd6 bayeux lvm2 a- 150.00G 37.91G /dev/sde6 bayeux lvm2 a- 150.00G 38.09G /dev/sde7 bayeux lvm2 a- 150.00G 39.41G joey@saluki ~ $ sudo lvm version LVM version: 2.02.42 (2008-10-26) Library version: 1.02.28 (2008-09-18) Driver version: 4.14.0 joey@saluki ~ $ sudo pvdisplay --maps /dev/sda --- Physical volume --- PV Name /dev/sda VG Name london PV Size 232.83 GB / not usable 2.58 MB Allocatable yes PE Size (KByte) 8192 Total PE 29802 Free PE 2794 Allocated PE 27008 PV UUID CaKw1l-1LQC-rzLl-2cYy-WBqc-6oH9-djYDBA --- Physical Segments --- Physical extent 0 to 17407: Logical volume /dev/london/mytharc Logical extents 35773 to 53180 Physical extent 17408 to 18687: FREE Physical extent 18688 to 28287: Logical volume /dev/london/mytharc Logical extents 53181 to 62780 Physical extent 28288 to 29801: FREE joey@saluki ~ $ sudo pvdisplay --maps /dev/sdb3 --- Physical volume --- PV Name /dev/sdb3 VG Name london PV Size 277.41 GB / not usable 5.32 MB Allocatable yes PE Size (KByte) 8192 Total PE 35508 Free PE 2436 Allocated PE 33072 PV UUID EWyqUK-Uvcf-mkoV-RG44-KTgl-WAfj-UiLh86 --- Physical Segments --- Physical extent 0 to 3166: Logical volume /dev/london/backup Logical extents 5749 to 8915 Physical extent 3167 to 4062: Logical volume /dev/london/mm Logical extents 0 to 895 Physical extent 4063 to 5342: Logical volume /dev/london/vm Logical extents 0 to 1279 Physical extent 5343 to 7306: Logical volume /dev/london/backup Logical extents 8916 to 10879 Physical extent 7307 to 8462: FREE Physical extent 8463 to 28340: Logical volume /dev/london/mythrec Logical extents 0 to 19877 Physical extent 28341 to 28377: Logical volume /dev/london/idb_log Logical extents 0 to 36 Physical extent 28378 to 28440: Logical volume /dev/london/idb_ts0 Logical extents 0 to 62 Physical extent 28441 to 28459: Logical volume /dev/london/root Logical extents 0 to 37 Physical extent 28460 to 28478: Logical volume /dev/london/root Logical extents 0 to 37 Physical extent 28479 to 29758: FREE Physical extent 29759 to 35507: Logical volume /dev/london/backup Logical extents 0 to 5748 joey@saluki ~ $ sudo pvdisplay --maps /dev/sdc --- Physical volume --- PV Name /dev/sdc VG Name london PV Size 279.48 GB / not usable 3.79 MB Allocatable yes (but full) PE Size (KByte) 8192 Total PE 35773 Free PE 0 Allocated PE 35773 PV UUID RcHS0s-zAfa-nuFm-Rp2O-xQx8-thUH-4ZiojY --- Physical Segments --- Physical extent 0 to 35772: Logical volume /dev/london/mytharc Logical extents 0 to 35772 joey@saluki ~ $ Reproducible: Always Steps to Reproduce: Not sure if there is something special about my config that makes this happen....see Description for steps I used to reproduce Actual Results: vgsplit does not peform any action Expected Results: vgsplit should have created new volume group munich using PVs /dev/sda and /dev/sdc, removing those same PVs from VG london.
Updating severity to minor since there is a workaround.....if you specify the PVs explicitly to be removed instead of implicitly by vgname, then it works joey@saluki ~ $ sudo vgsplit --verbose --debug london munich /dev/sda /dev/sdc Password: Checking for volume group "london" Checking for new volume group "munich" Wiping cache of LVM-capable devices Archiving volume group "london" metadata (seqno 185). Logical volume "mytharc" must be inactive joey@saluki ~ $ sudo lvchange -an /dev/london/mytharc joey@saluki ~ $ sudo vgsplit --verbose --debug --name mytharc london munich Checking for volume group "london" Checking for new volume group "munich" Wiping cache of LVM-capable devices Archiving volume group "london" metadata (seqno 185). Physical volume /dev/sda not in volume group london joey@saluki ~ $ sudo vgsplit --verbose --debug london munich /dev/sda /dev/sdc Checking for volume group "london" Checking for new volume group "munich" Wiping cache of LVM-capable devices Archiving volume group "london" metadata (seqno 185). Writing out updated volume groups Archiving volume group "munich" metadata (seqno 0). Creating volume group backup "/etc/lvm/backup/munich" (seqno 1). Creating volume group backup "/etc/lvm/backup/london" (seqno 186). Creating volume group backup "/etc/lvm/backup/munich" (seqno 2). New volume group "munich" successfully split from "london" joey@saluki ~ $ sudo pvs PV VG Fmt Attr PSize PFree /dev/md/saluki:r10_0 bayeux lvm2 a- 40.00G 3.50G /dev/md/saluki:r5_0 bayeux lvm2 a- 360.00G 7.00G /dev/sda munich lvm2 a- 232.83G 21.83G /dev/sdb3 london lvm2 a- 277.41G 19.03G /dev/sdc munich lvm2 a- 279.48G 0 /dev/sdd6 bayeux lvm2 a- 150.00G 37.91G /dev/sde6 bayeux lvm2 a- 150.00G 38.09G /dev/sde7 bayeux lvm2 a- 150.00G 39.41G joey@saluki ~ $
jharvell: - what version of lvm2 are you using? - Can you please repeat your tests with lvm2-2.02.49? - please always include emerge --info output.
The LVM version information was buried in the original description. I have copied it below: joey@saluki ~ $ sudo lvm version LVM version: 2.02.42 (2008-10-26) Library version: 1.02.28 (2008-09-18) Driver version: 4.14.0
tested with lvm2-2.02.49 and the bug apparently no longer exists I was able to do the split with test PVs, LVs and VGs as follows: joey@saluki ~ $ sudo pvcreate /dev/london/testpv1 Physical volume "/dev/london/testpv1" successfully created joey@saluki ~ $ sudo pvcreate /dev/london/testpv2 Physical volume "/dev/london/testpv2" successfully created joey@saluki ~ $ sudo pvcreate /dev/london/testpv3 Physical volume "/dev/london/testpv3" successfully created joey@saluki ~ $ sudo vgcreate -s 8M testvg /dev/london/testpv1 Volume group allocation policy is already normal Volume group "testvg" successfully created joey@saluki ~ $ sudo vgextend testvg /dev/london/testpv2 /dev/london/testpv3 Volume group "testvg" successfully extended joey@saluki ~ $ sudo pvs PV VG Fmt Attr PSize PFree /dev/dm-34 testvg lvm2 a- 96.00M 96.00M /dev/dm-44 testvg lvm2 a- 96.00M 96.00M /dev/dm-45 testvg lvm2 a- 96.00M 96.00M [snip] joey@saluki ~ $ sudo lvcreate -L 10M -n testlv1 testvg Rounding up size to full physical extent 16.00 MB Logical volume "testlv1" created joey@saluki ~ $ sudo lvextend -L 150M /dev/testvg/testlv1 Rounding up size to full physical extent 152.00 MB Extending logical volume testlv1 to 152.00 MB Logical volume testlv1 successfully resized joey@saluki ~ $ sudo lvdisplay --maps /dev/testvg/testlv1 --- Logical volume --- LV Name /dev/testvg/testlv1 VG Name testvg LV UUID cZysnq-mmW1-BJMG-1S62-zzdD-sFjN-a1xFXd LV Write Access read/write LV Status available # open 0 LV Size 152.00 MB Current LE 19 Segments 2 Allocation inherit Read ahead sectors auto - currently set to 256 Block device 254:46 --- Segments --- Logical extent 0 to 11: Type linear Physical volume /dev/dm-34 Physical extents 0 to 11 Logical extent 12 to 18: Type linear Physical volume /dev/dm-44 Physical extents 0 to 6 joey@saluki ~ $ sudo lvcreate -L 10M -n testlv2 testvg /dev/dm-45 Rounding up size to full physical extent 16.00 MB Logical volume "testlv2" created joey@saluki ~ $ sudo pvs PV VG Fmt Attr PSize PFree /dev/dm-34 testvg lvm2 a- 96.00M 0 /dev/dm-44 testvg lvm2 a- 96.00M 40.00M /dev/dm-45 testvg lvm2 a- 96.00M 80.00M [snip] joey@saluki ~ $ sudo lvchange -an /dev/testvg/testlv1 joey@saluki ~ $ sudo vgsplit --verbose --debug --name testlv1 testvg newtestvg Checking for volume group "testvg" Checking for new volume group "newtestvg" Wiping cache of LVM-capable devices Volume group allocation policy is already normal Archiving volume group "testvg" metadata (seqno 5). Writing out updated volume groups Archiving volume group "newtestvg" metadata (seqno 0). Creating volume group backup "/etc/lvm/backup/newtestvg" (seqno 1). Creating volume group backup "/etc/lvm/backup/testvg" (seqno 6). Creating volume group backup "/etc/lvm/backup/newtestvg" (seqno 2). New volume group "newtestvg" successfully split from "testvg" joey@saluki ~ $ sudo pvs PV VG Fmt Attr PSize PFree /dev/dm-34 newtestvg lvm2 a- 96.00M 0 /dev/dm-44 newtestvg lvm2 a- 96.00M 40.00M /dev/dm-45 testvg lvm2 a- 96.00M 80.00M [snip]