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
Been a week since I posted this bug, with no reply Can the messages be ignored ?
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.
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
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.
Hi Ben, Thanks for responding back. I can recompile it; please post the patch Thanks again Bart
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.
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
Yup, those numbers all match up. A package with this fix should be available in RHEL-4.8
thanks
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.
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
Patch applied
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.
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