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: pvdisplay Steps to Reproduce: 1. pvdisplay 2. 3. 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:~ #
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().
fixed in cvs
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 problems. Attached is the log of pvdisplay -vvv /dev/dasdb1.
Created attachment 138676 [details] pvdisplay -vvv /dev/dasdb1
Can you please attach a dump of the on disk metadata from both devices (using dd or running scripts/lvm_dump.sh -m)?
Created attachment 138689 [details] lvm_dump.tgz
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.