Bug 501390

Summary: Partial mode is broken for lvm1 PVs
Product: Red Hat Enterprise Linux 5 Reporter: Milan Broz <mbroz>
Component: lvm2Assignee: Milan Broz <mbroz>
Status: CLOSED CURRENTRELEASE QA Contact: Cluster QE <mspqa-list>
Severity: medium Docs Contact:
Priority: low    
Version: 5.3CC: agk, dwysocha, heinzm, iannis, jbrassow, mbroz, prockai, pvrabec
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-01-19 23:25:59 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:

Description Milan Broz 2009-05-18 21:12:57 UTC
Description of problem:
The partial mode is broken if PV is missing, partial mode is requested and PV are lvm1 format.

# 1) prepare not active lvm1 VG:

# pvcreate -M1 /dev/sd[bcfg]
  Physical volume "/dev/sdb" successfully created
  Physical volume "/dev/sdc" successfully created
  Physical volume "/dev/sdf" successfully created
  Physical volume "/dev/sdg" successfully created
# vgcreate -M1 vg_test /dev/sd[bcfg]
  Volume group "vg_test" successfully created
# lvcreate -l1 -n lv vg_test
  Logical volume "lv" created
# vgchange -a n
  0 logical volume(s) in volume group "vg_test" now active

# 2) destroy one of PVs

# pvcreate -ff /dev/sdc
Really INITIALIZE physical volume "/dev/sdc" of volume group "vg_test" [y/n]? y
  WARNING: Forcing physical volume creation on /dev/sdc of volume group "vg_test"
  Physical volume "/dev/sdc" successfully created

# 3) Try to backup VG in partial mode

# vgcfgbackup -f bck -P vg_test
  Partial mode. Incomplete volume groups will be activated read-only.
  3 PV(s) found for VG vg_test: expected 4
  PV segment VG free_count mismatch: 152599 != 228909
  PV segment VG extent_count mismatch: 152600 != 228910
  Internal error: PV segments corrupted in vg_test.
  Volume group "vg_test" not found

Version-Release number of selected component (if applicable):
# lvm version
  LVM version:     2.02.40-RHEL5 (2008-10-24)
  Library version: 1.02.28 (2008-09-18)
  Driver version:  4.11.5
# rpm -q lvm2
lvm2-2.02.40-6.el5.x86_64

(This is broken in all rhel5 lvm2 versions.)

Comment 3 Milan Broz 2010-07-07 11:45:47 UTC
upstream RFC patch is here, waiting fo some review...
https://www.redhat.com/archives/lvm-devel/2010-June/msg00166.html

Comment 4 Milan Broz 2011-01-19 23:25:59 UTC
Partial fix for this problem is already in RHEL5.6 release.

There is still issue in some situationsm though.
But because it requires quite amount of time to fix it properly and this situation is very rare (and simple command for updating metadata to lvm2 format exists) I am closing this.