Bug 210922 - pvdisplay reports invalid PV size
pvdisplay reports invalid PV size
Product: Fedora
Classification: Fedora
Component: lvm2 (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Alasdair Kergon
Depends On:
  Show dependency treegraph
Reported: 2006-10-16 11:50 EDT by Jan Blunck
Modified: 2007-11-30 17:11 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-01-10 13:35:33 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
pvdisplay -vvv /dev/dasdb1 (26.16 KB, text/plain)
2006-10-17 08:37 EDT, Jan Blunck
no flags Details
lvm_dump.tgz (129.79 KB, application/x-compressed-tar)
2006-10-17 11:16 EDT, Jan Blunck
no flags Details

  None (edit)
Description Jan Blunck 2006-10-16 11:50:00 EDT
Description of problem:
The size of old PVs (created with pvcreate from older LVM2 < 2.02.11) is
reported wrong.

Version-Release number of selected component (if applicable):
lvm2 2.02.11

How reproducible:

Steps to Reproduce:
1. pvdisplay
Actual results:
The following shows 2 PVs, one old one (/dev/dasdb1) and one new (/dev/dasdc1).

s390vm02:~ # pvdisplay 
  --- Physical volume ---
  PV Name               /dev/dasdb1
  VG Name               test
  PV Size               0    / not usable 8589934592.00 TB
  Allocatable           yes 
  PE Size (KByte)       4096
  Total PE              586
  Free PE               486
  Allocated PE          100
  PV UUID               ivSa2k-N2Uf-EiHi-nmWJ-OM4W-ta98-VmcvFT
  --- NEW Physical volume ---
  PV Name               /dev/dasdc1
  VG Name               
  PV Size               2.29 GB
  Allocatable           NO
  PE Size (KByte)       0
  Total PE              0
  Free PE               0
  Allocated PE          0
  PV UUID               gwMml3-Agcw-YBvO-TCs4-Zs73-BpeA-ONcPzf
s390vm02:~ # 

Expected results:

Additional info:
pvs is working fine:
s390vm02:~ # pvs
  PV          VG   Fmt  Attr PSize PFree
  /dev/dasdb1 test lvm2 a-   2.29G 1.90G
  /dev/dasdc1      lvm2 --   2.29G 2.29G
s390vm02:~ #
Comment 1 Alasdair Kergon 2006-10-16 12:17:07 EDT
The PV size handling in the code prior to 2.0.11 was poor - multiple pieces of
code deduce it in inconsistent ways.  2.0.11 moved towards defining the size
unambiguously in a single place in the code.  This has revealed an existing bug
in pvdisplay: pv_read() is only valid for orphans, not for PVs in VGs. 
pvdisplay was using it for PVs in VGs instead of using vg_read().
Comment 2 Alasdair Kergon 2006-10-16 12:30:03 EDT
fixed in cvs
Comment 3 Jan Blunck 2006-10-17 08:34:35 EDT
No, this isn't fixed in the CVS yet. I'm not sure what is exactly failing here.
A short strace shows that at least all the devices are read without obvious

Attached is the log of pvdisplay -vvv /dev/dasdb1.
Comment 4 Jan Blunck 2006-10-17 08:37:41 EDT
Created attachment 138676 [details]
pvdisplay -vvv /dev/dasdb1
Comment 5 Alasdair Kergon 2006-10-17 10:17:50 EDT
Can you please attach a dump of the on disk metadata from both devices (using dd
or running scripts/lvm_dump.sh -m)?
Comment 6 Jan Blunck 2006-10-17 11:16:59 EDT
Created attachment 138689 [details]
Comment 7 Alasdair Kergon 2006-10-20 14:56:08 EDT
A further update is reported to this.

But apparently pvmove was also broken by this in some way, which it is important
to have fixed.

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