Bug 488059 - pvcreate works incorretly with --metadatasize 4032k
pvcreate works incorretly with --metadatasize 4032k
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: lvm2 (Show other bugs)
5.3
x86_64 Linux
high Severity medium
: rc
: ---
Assigned To: Milan Broz
Cluster QE
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-03-02 07:29 EST by Kirby Zhou
Modified: 2013-02-28 23:07 EST (History)
9 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-09-02 07:56:27 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
pvcreate /dev/sdb --metadatasize=4032k -vvvvv &> pvcreate.log (2.57 KB, text/plain)
2009-03-02 21:31 EST, Kirby Zhou
no flags Details
pvs -vvvvv &> pvs.log (45.20 KB, text/plain)
2009-03-02 21:31 EST, Kirby Zhou
no flags Details
lvmdump -a (20.82 KB, application/x-gzip-compressed)
2009-03-02 21:32 EST, Kirby Zhou
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2009:1393 normal SHIPPED_LIVE lvm2 bug-fix and enhancement update 2009-09-01 08:00:22 EDT

  None (edit)
Description Kirby Zhou 2009-03-02 07:29:06 EST
Description of problem:

On my 3 RHEL-5.2/5.3 box, pvcreate or pvs show me 'Checksum error' if I create a pv with metadatasize=4032k.


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

lvm2-2.02.32-4.el5_2.1
lvm2-2.02.40-6.el5

How reproducible:

your /dev/sdb must be big enough (>=146G).
Then:

RHEL-5.3 with lvm2 from 5.3
[@89.112 ~]# pvcreate /dev/sda --metadatasize 4032k 
  Physical volume "/dev/sda" successfully created
[@89.112 ~]# pvs
  /dev/sda: Checksum error
  PV                VG     Fmt  Attr PSize   PFree  
  /dev/cciss/c0d0p2 vgroot lvm2 a-   136.50G      0 
  /dev/sda                 lvm2 --   136.73G 136.73G
[@89.112 ~]# pvremove /dev/sda                      

RHEL-5.3
[@63.36 ~]# pvcreate /dev/sdb --metadatasize=4032k 
  Physical volume "/dev/sdb" successfully created
[@63.36 ~]# pvs
  /dev/sdb: Checksum error
  PV         VG     Fmt  Attr PSize   PFree  
  /dev/sda2  vgroot lvm2 a-    33.16G      0 
  /dev/sdb          lvm2 --   136.12G 136.12G

RHEL-5.2
[@89.111 ~]# pvcreate /dev/md0 --metadatasize 4032k 
  Physical volume "/dev/md0" successfully created
[@89.111 ~]# pvs
  /dev/md0: Checksum error
  /dev/md0: Checksum error
  /dev/md0: Checksum error
  /dev/md0: Checksum error
  PV                VG     Fmt  Attr PSize   PFree  
  /dev/cciss/c0d0p2 vgroot lvm2 a-   136.50G      0 
  /dev/md0                 lvm2 --   410.07G 410.07G

  
Actual results:


Expected results:

Avoid the 'Checksum error' message.

Additional info:

My 3 servers are: HP 380 G5, HP 360 G5 and DELL 2950
Comment 1 Kirby Zhou 2009-03-02 07:30:31 EST
Any other metadatasize works fine, such as 4099 8128 123 192 and more.
Comment 2 Milan Broz 2009-03-02 07:45:46 EST
Hm, it works here on x86_64 with RHEL5.3.

Please can you attach output of pvcreate -vvvvv ... and if possible lvmdump archive?
Thanks.
Comment 3 Kirby Zhou 2009-03-02 21:31:13 EST
Created attachment 333810 [details]
pvcreate /dev/sdb --metadatasize=4032k  -vvvvv &> pvcreate.log
Comment 4 Kirby Zhou 2009-03-02 21:31:57 EST
Created attachment 333811 [details]
pvs -vvvvv &> pvs.log
Comment 5 Kirby Zhou 2009-03-02 21:32:48 EST
Created attachment 333812 [details]
lvmdump -a

[@63.36 ~]# lvmdump -a                         
Creating dump directory: /root/lvmdump-63.36-2009030322850
 
Gathering LVM volume info...
  vgscan...
  pvscan...
  lvs...
  pvs...
  vgs...
Gathering LVM & device-mapper version info...
Gathering dmsetup info...
Gathering process info...
Gathering console messages...
Gathering /etc/lvm info...
Gathering /dev listing...
Gathering /sys/block listing...
Creating report tarball in /root/lvmdump-63.36-2009030322850.tgz...
Comment 6 Kirby Zhou 2009-03-02 21:35:29 EST
[@63.36 ~]# uname -a
Linux 63.36 2.6.18-128.1.1.el5xen #1 SMP Mon Jan 26 14:19:09 EST 2009 x86_64 x86_64 x86_64 GNU/Linux

[@63.36 ~]# rpm -qa '*lvm*' 'device-mapper*'   
system-config-lvm-1.1.5-1.0.el5
device-mapper-event-1.02.28-2.el5
lvm2-2.02.40-6.el5
device-mapper-1.02.28-2.el5
device-mapper-multipath-0.4.7-23.el5
device-mapper-1.02.28-2.el5
Comment 7 Milan Broz 2009-03-03 04:24:01 EST
Yes there us some problem on x86_64, but cannot reproduce that with upstream on i386.

for i in `seq 600 4500` ; do pvcreate /dev/sdc --metadatasize "$i"k 2>&1 >/dev/null; pvs /dev/sdc 2>&1 |grep error && echo "(Using $i)"; done

  /dev/sdc: Checksum error
(Using 637)
  /dev/sdc: Checksum error
  /dev/sdc: Checksum error
(Using 638)
  /dev/sdc: Checksum error
  /dev/sdc: Checksum error
...
# 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

Ok, that's possible data corruption bug, thanks for reporting.
Comment 8 Milan Broz 2009-03-03 11:44:41 EST
The code produces correct PV header, but there was bug in processing header if e not yet text metadata area was defined (before vgcreate).

Fix commited upstream (for lvm2 2.02.45), will be in RHEL5.4

Easily reproduced with simple

pvcreate --metadatasize 637k <dev>
pvs <dev>
Comment 9 Milan Broz 2009-05-21 05:22:17 EDT
Fix in version lvm2-2.02.46-1.el5.
Comment 11 Corey Marthaler 2009-06-11 15:07:33 EDT
Unable to reproduce, marking verified.

Linux hayes-02 2.6.18-150.el5 #1 SMP Wed May 20 20:25:53 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux

[root@hayes-02 ~]# pvcreate --metadatasize 4032k /dev/etherd/e1.1p1
  Physical volume "/dev/etherd/e1.1p1" successfully created
[root@hayes-02 ~]# pvs
  PV                 VG         Fmt  Attr PSize  PFree
  /dev/etherd/e1.1p1            lvm2 --    1.27T 1.27T
  /dev/sda2          VolGroup00 lvm2 a-   74.38G    0 

lvm2-2.02.46-5.el5
Comment 13 errata-xmlrpc 2009-09-02 07:56:27 EDT
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 therefore 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-2009-1393.html

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