RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 875930 - vgsplit can not split two device mirrors where the log and a leg share the same device
Summary: vgsplit can not split two device mirrors where the log and a leg share the sa...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: lvm2
Version: 6.4
Hardware: x86_64
OS: Linux
medium
low
Target Milestone: rc
: ---
Assignee: Jonathan Earl Brassow
QA Contact: Cluster QE
URL:
Whiteboard:
Depends On:
Blocks: BrassowRHEL6Bugs
TreeView+ depends on / blocked
 
Reported: 2012-11-12 20:48 UTC by Corey Marthaler
Modified: 2014-10-14 08:23 UTC (History)
10 users (show)

Fixed In Version: lvm2-2.02.107-1.el6
Doc Type: Bug Fix
Doc Text:
No Documentation needed - command now works as expected.
Clone Of:
Environment:
Last Closed: 2014-10-14 08:23:36 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2014:1387 0 normal SHIPPED_LIVE lvm2 bug fix and enhancement update 2014-10-14 01:39:47 UTC

Description Corey Marthaler 2012-11-12 20:48:19 UTC
Description of problem:
[root@taft-01 ~]# pvscan
  PV /dev/sdb1   VG seven       lvm2 [135.66 GiB / 135.66 GiB free]
  PV /dev/sdc1   VG seven       lvm2 [135.66 GiB / 135.66 GiB free]
  PV /dev/sdd1   VG seven       lvm2 [135.66 GiB / 135.66 GiB free]
  PV /dev/sde1   VG seven       lvm2 [135.66 GiB / 135.66 GiB free]
  PV /dev/sdf1   VG seven       lvm2 [135.66 GiB / 135.66 GiB free]
  PV /dev/sdg1   VG seven       lvm2 [135.66 GiB / 135.66 GiB free]
  PV /dev/sdh1   VG seven       lvm2 [135.66 GiB / 135.66 GiB free]
  PV /dev/sda2   VG vg_taft01   lvm2 [67.75 GiB / 0    free]
  Total: 8 [1017.40 GiB] / in use: 8 [1017.40 GiB] / in no VG: 0 [0   ]
[root@taft-01 ~]# lvcreate -m 1 -n mirror1 -L 100M seven /dev/sdb1 /dev/sdc1 /dev/sdd1
  Logical volume "mirror1" created
[root@taft-01 ~]# lvcreate -m 1 -n mirror2 -L 100M seven /dev/sde1 /dev/sdf1
  Logical volume "mirror2" created
[root@taft-01 ~]# lvs -a -o +devices
  LV                 VG     Attr      LSize   Log          Cpy%Sync Devices
  mirror1            seven  mwi-a-m-- 100.00m mirror1_mlog   100.00 mirror1_mimage_0(0),mirror1_mimage_1(0)
  [mirror1_mimage_0] seven  iwi-aom-- 100.00m                       /dev/sdb1(0)
  [mirror1_mimage_1] seven  iwi-aom-- 100.00m                       /dev/sdc1(0)
  [mirror1_mlog]     seven  lwi-aom--   4.00m                       /dev/sdd1(0)
  mirror2            seven  mwi-a-m-- 100.00m mirror2_mlog   100.00 mirror2_mimage_0(0),mirror2_mimage_1(0)
  [mirror2_mimage_0] seven  iwi-aom-- 100.00m                       /dev/sde1(0)
  [mirror2_mimage_1] seven  iwi-aom-- 100.00m                       /dev/sdf1(0)
  [mirror2_mlog]     seven  lwi-aom--   4.00m                       /dev/sdf1(25)

[root@taft-01 ~]# vgsplit -n mirror1 seven ten
  Logical volume "mirror1_mimage_0" must be inactive

[root@taft-01 ~]# vgsplit -n mirror2 seven ten
  Physical volume /dev/sdf1 not in volume group seven

# But /dev/sdf1 *IS* in volume group seven


Version-Release number of selected component (if applicable):
2.6.32-338.el6.x86_64

lvm2-2.02.98-3.el6    BUILT: Mon Nov  5 06:45:48 CST 2012
lvm2-libs-2.02.98-3.el6    BUILT: Mon Nov  5 06:45:48 CST 2012
lvm2-cluster-2.02.98-3.el6    BUILT: Mon Nov  5 06:45:48 CST 2012
udev-147-2.43.el6    BUILT: Thu Oct 11 05:59:38 CDT 2012
device-mapper-1.02.77-3.el6    BUILT: Mon Nov  5 06:45:48 CST 2012
device-mapper-libs-1.02.77-3.el6    BUILT: Mon Nov  5 06:45:48 CST 2012
device-mapper-event-1.02.77-3.el6    BUILT: Mon Nov  5 06:45:48 CST 2012
device-mapper-event-libs-1.02.77-3.el6    BUILT: Mon Nov  5 06:45:48 CST 2012
cmirror-2.02.98-3.el6    BUILT: Mon Nov  5 06:45:48 CST 2012

Comment 3 Alasdair Kergon 2013-10-08 12:57:30 UTC
Any similar problems with raid?

Comment 4 Corey Marthaler 2013-10-10 16:42:18 UTC
If you use --alloc anywhere to force the 2-device raid lay out, then yes, the same issue occurs in raid volumes as well.

[root@virt-020 ~]# lvcreate --type raid5 -n raid -i 2 -L 100M seven /dev/sdc1 /dev/sdd1
  Using default stripesize 64.00 KiB
  Rounding size (25 extents) up to stripe boundary size (26 extents).
  Insufficient suitable allocatable extents for logical volume raid: 28 more required

[root@virt-020 ~]# lvcreate --alloc anywhere --type raid5 -n raid -i 2 -L 100M seven /dev/sdc1 /dev/sdd1
  Using default stripesize 64.00 KiB
  Rounding size (25 extents) up to stripe boundary size (26 extents).
  Logical volume "raid" created

[root@virt-020 ~]# vgsplit -n raid seven ten
  Physical volume /dev/sdc1 not in volume group seven

Comment 6 Jonathan Earl Brassow 2014-04-10 21:02:57 UTC
I thought this bug would affect thin-p also, since it is possible to put data and metadata on the same device.  However, the code ignores the thin pool metadata device in that case and it works when everything is on the same device.  However, when thin-p sub-LVs are on different devices (i.e. the normal case), it doesn't work:

[root@bp-01 ~]# vgsplit -n thin_pool vg vg_new
  Can't split pool data and metadata thin_pool between two Volume Groups.
[root@bp-01 ~]# vgsplit -n thin_lv vg vg_new
  Cannot split: Nowhere to store metadata for new Volume Group

Probably a separate bug for that.  I'm sure it works fine if just PVs are specified.

Comment 7 Jonathan Earl Brassow 2014-04-25 22:02:42 UTC
Fix committed upstream:

commit 76687f4cacd6ca3f8953d4ee915efc159838cd91
Author: Jonathan Brassow <jbrassow>
Date:   Fri Apr 25 14:55:32 2014 -0500

    WHATS_NEW: Add message for commit 9ac858f
    
    WHATS_NEW for commit:
    9ac858f vgsplit: Make vgsplit work on mirrors with leg and log on same PV

commit 9ac858fe6b56318cee821e86e4a5edede75d5134
Author: Jonathan Brassow <jbrassow>
Date:   Fri Apr 25 14:53:34 2014 -0500

    vgsplit: Make vgsplit work on mirrors with leg and log on same PV
    
    Given a named mirror LV, vgsplit will look for the PVs that compose it
    and move them to a new VG.  It does this by first looking at the log
    and then the legs.  If the log is on the same device as one of the mirror
    images, a problem occurs.  This is because the PV is moved to the new VG
    as the log is processed and thus cannot be found in the current VG when
    the image is processed.  The solution is to check and see if the PV we are
    looking for has already been moved to the new VG.  If so, it is not an
    error.

Comment 9 Nenad Peric 2014-07-14 16:58:51 UTC
[root@virt-122 ~]# pvscan
  PV /dev/sdb    VG seven        lvm2 [15.00 GiB / 15.00 GiB free]
  PV /dev/sdc    VG seven        lvm2 [15.00 GiB / 15.00 GiB free]
  PV /dev/sdd    VG seven        lvm2 [15.00 GiB / 15.00 GiB free]
  PV /dev/sde    VG seven        lvm2 [15.00 GiB / 15.00 GiB free]
  PV /dev/sdf    VG seven        lvm2 [15.00 GiB / 15.00 GiB free]
  PV /dev/sdg    VG seven        lvm2 [15.00 GiB / 15.00 GiB free]
  PV /dev/sdh    VG seven        lvm2 [15.00 GiB / 15.00 GiB free]
  PV /dev/vda2   VG vg_virt122   lvm2 [7.51 GiB / 0    free]
  PV /dev/sda                    lvm2 [15.00 GiB]
  Total: 9 [127.48 GiB] / in use: 8 [112.48 GiB] / in no VG: 1 [15.00 GiB]
[root@virt-122 ~]# lvcreate -m 1 -n mirror1 -L 100M seven /dev/sdb /dev/sdc /dev/sdd
  Logical volume "mirror1" created
[root@virt-122 ~]# lvcreate -m 1 -n mirror2 -L 100M seven /dev/sde /dev/sdf 
  Logical volume "mirror2" created

[root@virt-122 ~]# vgsplit -n mirror1 seven ten
  Logical volume seven/mirror1_mimage_0 (part of mirror1) must be inactive.
[root@virt-122 ~]# vgsplit -n mirror2 seven ten
  Logical volume seven/mirror2_mimage_0 (part of mirror2) must be inactive.
[root@virt-122 ~]# lvchange -an seven/mirror2
[root@virt-122 ~]# vgsplit -n mirror2 seven ten
  New volume group "ten" successfully split from "seven"
[root@virt-122 ~]# vgs
  VG         #PV #LV #SN Attr   VSize  VFree 
  seven        5   1   0 wz--n- 74.98g 74.78g
  ten          2   1   0 wz--n- 29.99g 29.79g
  vg_virt122   1   2   0 wz--n-  7.51g     0 
[root@virt-122 ~]# lvs -a
  LV                 VG         Attr       LSize   Pool Origin Data%  Meta%  Move Log          Cpy%Sync Convert
  mirror1            seven      mwi-a-m--- 100.00m                                mirror1_mlog 100.00          
  [mirror1_mimage_0] seven      iwi-aom--- 100.00m                                                             
  [mirror1_mimage_1] seven      iwi-aom--- 100.00m                                                             
  [mirror1_mlog]     seven      lwi-aom---   4.00m                                                             
  mirror2            ten        mwi---m--- 100.00m                                mirror2_mlog                 
  [mirror2_mimage_0] ten        Iwi---m--- 100.00m                                                             
  [mirror2_mimage_1] ten        Iwi---m--- 100.00m                                                             
  [mirror2_mlog]     ten        lwi---m---   4.00m                                                             
  lv_root            vg_virt122 -wi-ao----   6.71g                                                             
  lv_swap            vg_virt122 -wi-ao---- 816.00m                               


The split worked as expected.
The naming of the LV displayed in the error message from vgsplit is covered by a separate bug (Bug 1115004)

marking VERIFIED with:

lvm2-2.02.107-2.el6    BUILT: Fri Jul 11 15:47:33 CEST 2014
lvm2-libs-2.02.107-2.el6    BUILT: Fri Jul 11 15:47:33 CEST 2014
lvm2-cluster-2.02.107-2.el6    BUILT: Fri Jul 11 15:47:33 CEST 2014
udev-147-2.55.el6    BUILT: Wed Jun 18 13:30:21 CEST 2014
device-mapper-1.02.86-2.el6    BUILT: Fri Jul 11 15:47:33 CEST 2014
device-mapper-libs-1.02.86-2.el6    BUILT: Fri Jul 11 15:47:33 CEST 2014
device-mapper-event-1.02.86-2.el6    BUILT: Fri Jul 11 15:47:33 CEST 2014
device-mapper-event-libs-1.02.86-2.el6    BUILT: Fri Jul 11 15:47:33 CEST 2014
device-mapper-persistent-data-0.3.2-1.el6    BUILT: Fri Apr  4 15:43:06 CEST 2014
cmirror-2.02.107-2.el6    BUILT: Fri Jul 11 15:47:33 CEST 2014

Comment 10 errata-xmlrpc 2014-10-14 08:23:36 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2014-1387.html


Note You need to log in before you can comment on or make changes to this bug.