Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
For bugs related to Red Hat Enterprise Linux 4 product line. The current stable release is 4.9. For Red Hat Enterprise Linux 6 and above, please visit Red Hat JIRA https://issues.redhat.com/secure/CreateIssue!default.jspa?pid=12332745 to report new issues.

Bug 203037

Summary: deactivation of lv with snapshots may leave broken linked dev entries around
Product: Red Hat Enterprise Linux 4 Reporter: Corey Marthaler <cmarthal>
Component: lvm2Assignee: Milan Broz <mbroz>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 4.0CC: agk, dwysocha, mbroz, pvrabec
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: RHBA-2007-0753 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-11-15 15:58:19 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:
Attachments:
Description Flags
Proposed fix/workaround none

Description Corey Marthaler 2006-08-17 21:54:59 UTC
Description of problem:
Here's the easiest way to reproduce this:
[root@taft-04 ~]# pvscan
  PV /dev/sdb1         lvm2 [136.23 GB]
  PV /dev/sdb2         lvm2 [136.23 GB]
  PV /dev/sdc1         lvm2 [136.23 GB]
  PV /dev/sdc2         lvm2 [136.23 GB]
  PV /dev/sdd1         lvm2 [930.89 GB]
  PV /dev/sdd2         lvm2 [930.89 GB]
  Total: 6 [2.35 TB] / in use: 0 [0   ] / in no VG: 6 [2.35 TB]

[root@taft-04 ~]# vgcreate vg /dev/sdb1 /dev/sdb2 /dev/sdc1 /dev/sdc2
  Volume group "vg" successfully created

[root@taft-04 ~]# lvcreate -n origin -L 100M vg
  Logical volume "origin" created

[root@taft-04 ~]# lvcreate -s /dev/vg/origin -L 10M -n snap
  Rounding up size to full physical extent 12.00 MB
  Logical volume "snap" created

[root@taft-04 ~]# lvchange -an /dev/vg/origin

[root@taft-04 ~]# lvscan
  inactive Original '/dev/vg/origin' [100.00 MB] inherit
  inactive Snapshot '/dev/vg/snap' [12.00 MB] inherit

[root@taft-04 ~]# pvscan
  PV /dev/sdb1   VG vg   lvm2 [136.23 GB / 136.13 GB free]
  PV /dev/sdb2   VG vg   lvm2 [136.23 GB / 136.22 GB free]
  PV /dev/sdc1   VG vg   lvm2 [136.23 GB / 136.23 GB free]
  PV /dev/sdc2   VG vg   lvm2 [136.23 GB / 136.23 GB free]
  PV /dev/sdd1           lvm2 [930.89 GB]
  PV /dev/sdd2           lvm2 [930.89 GB]
  Total: 6 [2.35 TB] / in use: 4 [544.92 GB] / in no VG: 2 [1.82 TB]

[root@taft-04 ~]# vgsplit vg new_vg /dev/sdb1 /dev/sdb2 /dev/sdc1 /dev/sdc2
  Volume group "new_vg" successfully split from "vg"

# Broken Link!
[root@taft-04 ~]# ls /dev/vg
snap

[root@taft-04 ~]# lvscan
  inactive Original '/dev/new_vg/origin' [100.00 MB] inherit
  inactive Snapshot '/dev/new_vg/snap' [12.00 MB] inherit


Version-Release number of selected component (if applicable):
[root@taft-04 ~]# rpm -q lvm2
lvm2-2.02.06-6.0.RHEL4

How reproducible:
everytime

Comment 1 Milan Broz 2007-03-15 09:44:32 UTC
Correcting summary, problem is in deactivation of lv, not in vgsplit.

# lvcreate -n lv -L 100M vg_test
# lvcreate -s -n lv_snap -L 10M vg_test/lv
# lvchange -a n vg_test/lv
# ls -l /dev/vg_test/
total 0
lrwxrwxrwx 1 root root 27 Mar 14 15:13 lv_snap -> /dev/mapper/vg_test-lv_snap



Comment 2 Milan Broz 2007-03-15 09:48:11 UTC
Created attachment 150115 [details]
Proposed fix/workaround

Patch for lvm2 2.02.24-cvs

Comment 3 RHEL Program Management 2007-05-09 09:49:01 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.

Comment 4 Milan Broz 2007-05-15 15:02:15 UTC
Fixed upstream in 2.02.26.

Comment 7 Corey Marthaler 2007-07-27 16:29:55 UTC
fix verified in lvm2-2.02.27-1.el4

Comment 9 errata-xmlrpc 2007-11-15 15:58:19 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2007-0753.html