Bug 455616 - Running kpartx –a against a gpt labeled disk results in messages
Summary: Running kpartx –a against a gpt labeled disk results in messages
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: device-mapper-multipath
Version: 4.4
Hardware: All
OS: Linux
low
medium
Target Milestone: rc
: ---
Assignee: Ben Marzinski
QA Contact: Corey Marthaler
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-07-16 17:00 UTC by Bart Brooks
Modified: 2010-01-12 02:32 UTC (History)
14 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
* kpartx used 32-bit variables, which did not allow it to handle devices larger than 2 TB. When partitioning such a device, kpartx would alert the user with GPT error messages. Kpartx now uses 64-bit variables and successfully partitions devices larger than 2 TB.
Clone Of:
Environment:
Last Closed: 2009-05-18 20:32:01 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Fix to make kpartx 64bit compatable. (6.39 KB, patch)
2008-07-28 23:19 UTC, Ben Marzinski
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2009:1011 0 normal SHIPPED_LIVE device-mapper-multipath bug-fix update and enhancement 2009-05-18 14:11:59 UTC

Description Bart Brooks 2008-07-16 17:00:13 UTC
Messages appear when trying to use kpartx –a on a 4.7 TB disk, which has a 
parted gpt disk label

GPT:Primary header thinks Alt. header is not at the end of the disk.
GPT:Alternate GPT header not at the end of the disk.
GPT: Use GNU Parted to correct GPT errors.

Using Red Hat 4 Update 4 and the latest multipath and parted –
Create a gpt label and 2 partitions

[root@rhel432 ~]# parted /dev/dm-2
GNU Parted 1.6.19
Copyright (C) 1998 - 2004 Free Software Foundation, Inc.
This program is free software, covered by the GNU General Public License.

This program is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.  See the GNU General Public License for more details.

Using /dev/dm-2
(parted) mklabel gpt
(parted) print
Disk geometry for /dev/dm-2: 0.000-4944896.000 megabytes
Disk label type: gpt
Minor    Start       End     Filesystem  Name                  Flags
(parted) mkpart primary ext3 0 4000000M
(parted) mkpart primary ext3 4000001M 4900000M
(parted) print
Disk geometry for /dev/dm-2: 0.000-4944896.000 megabytes
Disk label type: gpt
Minor    Start       End     Filesystem  Name                  Flags
1          0.017 4000000.000
2     4000001.000 4900000.000
(parted) quit
[root@rhel432 ~]# kpartx -a /dev/dm-2
GPT:Primary header thinks Alt. header is not at the end of the disk.
GPT:Alternate GPT header not at the end of the disk.
GPT: Use GNU Parted to correct GPT errors.

Are the above messages just warnings; if so can they just be ignored ?
The partition mapping appear in /dev/mapper
[root@rhel432 ~]# ls -ls /dev/mapper/dm-2*
0 brw-rw----  1 root disk 253, 3 Jul 16 11:42 /dev/mapper/dm-2p1
0 brw-rw----  1 root disk 253, 4 Jul 16 11:42 /dev/mapper/dm-2p2

I can make a file system on the /dev/mapper/dm-2p1 or /dev/mapper/dm-2p2 and 
mount them up

Comment 1 Bart Brooks 2008-07-24 14:01:18 UTC
Been a week since I posted this bug, with no reply 

Can the messages be ignored ?

Comment 2 Ben Marzinski 2008-07-24 18:28:32 UTC
I don't have any large enough devices to test with currently, but I'm not at all
certain that devices larger that 2Tb will work on RHEL 4.  However, if the
devices were created, and you can access them, and they are set up correctly, then
you should be fine.

If you can run parted on the underlying device (not the dm device, which doesn't
necessarily have the real geometry information), run kpartx on the dm device,
and then run "dmsetup table", and put all the results into this bugzilla, I
should be able to see if the kpartx partitions were set up correctly.

Comment 3 Bart Brooks 2008-07-24 21:11:57 UTC
Thanks for responding back. I re-ran parted, kpartx and dmsetup table; please 
see below:

[root@rhel432 ~]# parted /dev/sdb
GNU Parted 1.6.19
Copyright (C) 1998 - 2004 Free Software Foundation, Inc.
This program is free software, covered by the GNU General Public License.

This program is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.  See the GNU General Public License for more details.

Using /dev/sdb
(parted) mklabel gpt
(parted) print
Disk geometry for /dev/sdb: 0.000-4610048.000 megabytes
Disk label type: gpt
Minor    Start       End     Filesystem  Name                  Flags
(parted) mkpart primary ext3 0 4000000M
(parted) mkpart primary ext3 4000001M 4600000M
(parted) print
Disk geometry for /dev/sdb: 0.000-4610048.000 megabytes
Disk label type: gpt
Minor    Start       End     Filesystem  Name                  Flags
1          0.017 4000000.000
2     4000001.000 4600000.000

[root@rhel432 ~]# kpartx -a /dev/dm-2
GPT:Primary header thinks Alt. header is not at the end of the disk.
GPT:Alternate GPT header not at the end of the disk.
GPT: Use GNU Parted to correct GPT errors.

[root@rhel432 ~]# dmsetup table dm-2p1
0 3897032671 linear 253:2 34
[root@rhel432 ~]# dmsetup table dm-2p2
0 1228797953 linear 253:2 3897034752


Comment 4 Ben Marzinski 2008-07-24 22:11:32 UTC
No, it does not appear that kpartx correctly set up partitions on you system.
looking at the dmsetup output

[root@rhel432 ~]# dmsetup table dm-2p
0 3897032671 linear 253:2 34

The partition goes from sector 34 (.017 MB) to 3897032705 (3897032671 + 34 or
1902848.000 MB).  This is happening because in RHEL4, kpartx doesn't correctly
address devices over 2TB.  This is fixed in RHEL5.  The fix can be backported to
RHEL4, but a package won't be available until RHEL 4.8.  If you are willing to
recompile it yourself, I can post a patch to change this.

Comment 5 Bart Brooks 2008-07-24 22:45:47 UTC
Hi Ben,

Thanks for responding back. I can recompile it; please post the patch 

Thanks again

Bart

Comment 6 Ben Marzinski 2008-07-28 23:19:47 UTC
Created attachment 312830 [details]
Fix to make kpartx 64bit compatable.

Here is the patch. It applies cleanly against the just released RHEL 4.7
device-mapper-multipath package device-mapper-multipath-0.4.5-31.el4.  If you
can't upgrade to the latest version, you can either tweak the patch yourself if
it doesn't apply (there shouldn't be any big problems), or let me know which
package you need it to apply on.

Comment 7 Bart Brooks 2008-07-29 17:03:33 UTC
Thanks for the patch, I have applied it to kpartx and rebuilt it.
Running kpartx –x no longer produces warning messages.
Could you please verify the values returned by dmsetup table, please see below

[root@rhel432 kpartx]# parted /dev/sdb
GNU Parted 1.6.19
Copyright (C) 1998 - 2004 Free Software Foundation, Inc.
This program is free software, covered by the GNU General Public License.

This program is distributed in the hope that it will be useful, but WITHOUT ANY 
WARRANTY; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See 
the GNU General Public
License for more details.

Using /dev/sdb
(parted) mklabel gpt
(parted) print
Disk geometry for /dev/sdb: 0.000-4610048.000 megabytes
Disk label type: gpt
Minor    Start       End     Filesystem  Name                  Flags
(parted) mkpart primary ext3 0 4000000M
(parted) mkpart primary ext3 4000001M 4600000M
(parted) print
Disk geometry for /dev/sdb: 0.000-4610048.000 megabytes
Disk label type: gpt
Minor    Start       End     Filesystem  Name                  Flags
1          0.017 4000000.000
2     4000001.000 4600000.000
(parted) quit

[root@rhel432 kpartx]# /root/kpartx -a /dev/dm-2
[root@rhel432 kpartx]# dmsetup table dm-2p1
0 8191999967 linear 253:2 34
[root@rhel432 kpartx]# dmsetup table dm-2p2
0 1228797953 linear 253:2 8192002048

Thanks again,
Bart

Comment 8 Ben Marzinski 2008-07-29 19:27:07 UTC
Yup, those numbers all match up. A package with this fix should be available in
RHEL-4.8

Comment 9 Bart Brooks 2008-07-29 19:33:23 UTC
thanks

Comment 10 RHEL Program Management 2008-09-05 17:16:07 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 11 Bart Brooks 2008-11-20 00:09:02 UTC
This is a known issue, which Ben has fixed, see comment #8.
I'm not the only one who could run into this issue in RH 4.x
Without his fix you can lose data -

Could you please supply the fix in an update.

Thanks

Bart

Comment 12 Ben Marzinski 2009-01-19 22:55:09 UTC
Patch applied

Comment 14 Ruediger Landmann 2009-02-02 05:47:18 UTC
Release note added. If any revisions are required, please set the 
"requires_release_notes" flag to "?" and edit the "Release Notes" field accordingly.
All revisions will be proofread by the Engineering Content Services team.

New Contents:
* kpartx used 32-bit variables, which did not allow it to handle devices larger than 2 TB. When partitioning such a device, kpartx would alert the user with GPT error messages. Kpartx now uses 64-bit variables and successfully partitions devices larger than 2 TB.

Comment 16 errata-xmlrpc 2009-05-18 20:32:01 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 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-1011.html


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