Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 806465

Summary: RAID1 split mirror fails when any PV but the last one is chosen
Product: Red Hat Enterprise Linux 6 Reporter: Corey Marthaler <cmarthal>
Component: lvm2Assignee: Jonathan Earl Brassow <jbrassow>
Status: CLOSED ERRATA QA Contact: Cluster QE <mspqa-list>
Severity: high Docs Contact:
Priority: high    
Version: 6.3CC: agk, dwysocha, heinzm, jbrassow, mbroz, msnitzer, prajnoha, prockai, slevine, thornber, zkabelac
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: lvm2-2.02.95-5.el6 Doc Type: Bug Fix
Doc Text:
New feature in rhel6.3. No release notes necessary.
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-06-20 15:03:09 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 732466    

Description Corey Marthaler 2012-03-23 20:15:42 UTC
The split mirror only works when the last leg PV is chosen.

[root@taft-01 ~]# lvs -a -o +devices
  LV                                VG          Attr     LSize   Copy%  Devices
  split_pvs_sequentially            split_image rwi-a-m- 300.00m 100.00 split_pvs_sequentially_rimage_0(0),split_pvs_sequentially_rimage_1(0),split_pvs_sequentially_rimage_2(0),split_pvs_sequentially_rimage_3(0)
  [split_pvs_sequentially_rimage_0] split_image iwi-aor- 300.00m        /dev/sdh1(1)
  [split_pvs_sequentially_rimage_1] split_image iwi-aor- 300.00m        /dev/sdg1(1)
  [split_pvs_sequentially_rimage_2] split_image iwi-aor- 300.00m        /dev/sdf1(1)
  [split_pvs_sequentially_rimage_3] split_image iwi-aor- 300.00m        /dev/sde1(1)
  [split_pvs_sequentially_rmeta_0]  split_image ewi-aor-   4.00m        /dev/sdh1(0)
  [split_pvs_sequentially_rmeta_1]  split_image ewi-aor-   4.00m        /dev/sdg1(0)
  [split_pvs_sequentially_rmeta_2]  split_image ewi-aor-   4.00m        /dev/sdf1(0)
  [split_pvs_sequentially_rmeta_3]  split_image ewi-aor-   4.00m        /dev/sde1(0)

[root@taft-01 ~]# lvconvert --splitmirrors 1 --name new1 split_image/split_pvs_sequentially /dev/sdg1
  device-mapper: rename ioctl on split_image-split_pvs_sequentially_rimage_3 failed: Device or resource busy
  Failed to rename split_image-split_pvs_sequentially_rimage_3 (253:9) to split_image-split_pvs_sequentially_rimage_2
  Failed to resume split_image/split_pvs_sequentially after committing changes
  libdevmapper exiting with 9 device(s) still suspended.


Version-Release number of selected component (if applicable):
2.6.32-220.4.2.el6.x86_64
lvm2-2.02.95-2.el6    BUILT: Fri Mar 16 08:39:54 CDT 2012
lvm2-libs-2.02.95-2.el6    BUILT: Fri Mar 16 08:39:54 CDT 2012
lvm2-cluster-2.02.95-2.el6    BUILT: Fri Mar 16 08:39:54 CDT 2012
udev-147-2.40.el6    BUILT: Fri Sep 23 07:51:13 CDT 2011
device-mapper-1.02.74-2.el6    BUILT: Fri Mar 16 08:39:54 CDT 2012
device-mapper-libs-1.02.74-2.el6    BUILT: Fri Mar 16 08:39:54 CDT 2012
device-mapper-event-1.02.74-2.el6    BUILT: Fri Mar 16 08:39:54 CDT 2012
device-mapper-event-libs-1.02.74-2.el6    BUILT: Fri Mar 16 08:39:54 CDT 2012
cmirror-2.02.95-2.el6    BUILT: Fri Mar 16 08:39:54 CDT 2012


How reproducible:
Everytime

Comment 1 Steven J. Levine 2012-04-09 21:18:46 UTC
I came across this same issue when I was trying to put together an example for the documentation that specified which PV to remove from a RAID volume.

This was the volume I started with:

[root@doc-04 lvm]# lvs -a -o name,copy_percent,devices vg001
  LV               Copy%  Devices
  my_lv            100.00 my_lv_rimage_0(0),my_lv_rimage_1(0),my_lv_rimage_2(0)
  [my_lv_rimage_0]        /dev/vda(1)
  [my_lv_rimage_1]        /dev/vdb(1)
  [my_lv_rimage_2]        /dev/vdc(1)
  [my_lv_rmeta_0]         /dev/vda(0)
  [my_lv_rmeta_1]         /dev/vdb(0)
  [my_lv_rmeta_2]         /dev/vdc(0)

When I executed the splitmirror command and specified the middle PV, this was the result:

[root@doc-04 lvm]# lvconvert --splitmirror 1 -n new vg001/my_lv /dev/vdb
  device-mapper: rename ioctl on vg001-my_lv_rimage_2 failed: Device or resource busy
  Failed to rename vg001-my_lv_rimage_2 (253:7) to vg001-my_lv_rimage_1
  Failed to resume vg001/my_lv after committing changes
  libdevmapper exiting with 7 device(s) still suspended.

This left the system frozen. It's a virtual system, and it wouldn't shutdown -- I had to destroy it and reboot it. This was the state when I brought things back up:

[root@doc-04 ~]# lvs
  LV                      VG       Attr     LSize   Pool Origin Data%  Move Log Copy%  Convert
  my_lv                   vg001    rwi-a-m- 100.00m                             100.00
  my_lv_rmeta_1_extracted vg001    -wi-a---   4.00m
  new                     vg001    -wi-a--- 100.00m
  lv_root                 vg_doc04 -wi-ao--   2.54g
  lv_swap                 vg_doc04 -wi-ao--   1.97g


[root@doc-04 ~]# lvs -a -o name,copy_percent,devices vg001
  LV                      Copy%  Devices
  my_lv                   100.00 my_lv_rimage_0(0),my_lv_rimage_1(0)
  [my_lv_rimage_0]               /dev/vda(1)
  [my_lv_rimage_1]               /dev/vdc(1)
  [my_lv_rmeta_0]                /dev/vda(0)
  [my_lv_rmeta_1]                /dev/vdc(0)
  my_lv_rmeta_1_extracted        /dev/vdb(0)
  new                            /dev/vdb(1)

I had to lvremove the volume "new" and the volume "my_lv_rmeta_1_extracted".

I'm adding myself to the CC list so I can see updates to this. For the moment I won't be documenting an example of specifyin gwhich PV to remove with a splitmirror command.

Comment 2 Jonathan Earl Brassow 2012-04-11 14:28:17 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
New feature in rhel6.3.  No release notes necessary.

Comment 8 Corey Marthaler 2012-04-19 19:01:10 UTC
Fix verified in the latest rpms.

2.6.32-262.el6.x86_64
lvm2-2.02.95-5.el6    BUILT: Thu Apr 19 10:29:01 CDT 2012
lvm2-libs-2.02.95-5.el6    BUILT: Thu Apr 19 10:29:01 CDT 2012
lvm2-cluster-2.02.95-5.el6    BUILT: Thu Apr 19 10:29:01 CDT 2012
udev-147-2.41.el6    BUILT: Thu Mar  1 13:01:08 CST 2012
device-mapper-1.02.74-5.el6    BUILT: Thu Apr 19 10:29:01 CDT 2012
device-mapper-libs-1.02.74-5.el6    BUILT: Thu Apr 19 10:29:01 CDT 2012
device-mapper-event-1.02.74-5.el6    BUILT: Thu Apr 19 10:29:01 CDT 2012
device-mapper-event-libs-1.02.74-5.el6    BUILT: Thu Apr 19 10:29:01 CDT 2012
cmirror-2.02.95-5.el6    BUILT: Thu Apr 19 10:29:01 CDT 2012


============================================================
Iteration 10 of 10 started at Thu Apr 19 13:59:07 CDT 2012
============================================================
SCENARIO - [sequentially_split_off_all_raid1_pvs]
Create a raid1 with many legs and then sequentially split off each one of the PVs
taft-01: lvcreate --type raid1 -m 4 -n split_pvs_sequentially -L 300M split_image
Waiting until all mirror|raid volumes become fully syncd...
   0/1 mirror(s) are fully synced: ( 86.25% )
   1/1 mirror(s) are fully synced: ( 100.00% )

splitting off legs:
         /dev/sde1 /dev/sdh1 /dev/sdd1 /dev/sdf1
Deactivating mirror new0... and removing
Deactivating mirror new1... and removing
Deactivating mirror new2... and removing
Deactivating mirror new3... and removing
Deactivating mirror split_pvs_sequentially... and removing

Comment 9 errata-xmlrpc 2012-06-20 15:03:09 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-2012-0962.html