GNU bug report logs - #19137
mklabel gpt created invalid Protective MBR

Previous Next

Package: parted;

Reported by: "Ulrich Windl" <Ulrich.Windl <at> rz.uni-regensburg.de>

Date: Fri, 21 Nov 2014 07:52:02 UTC

Severity: normal

To reply to this bug, email your comments to 19137 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-parted <at> gnu.org:
bug#19137; Package parted. (Fri, 21 Nov 2014 07:52:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Ulrich Windl" <Ulrich.Windl <at> rz.uni-regensburg.de>:
New bug report received and forwarded. Copy sent to bug-parted <at> gnu.org. (Fri, 21 Nov 2014 07:52:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "Ulrich Windl" <Ulrich.Windl <at> rz.uni-regensburg.de>
To: <bug-parted <at> gnu.org>
Subject: mklabel gpt created invalid Protective MBR
Date: Fri, 21 Nov 2014 08:50:24 +0100
GNU Parted 2.3 creates an invalid Protective MBR (for a 3MB test image):
--
hexdump -C gptgood
00000000  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
000001c0  01 00 ee fe ff ff 01 00  00 00 ff 17 00 00 00 00  |................|
000001d0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
000001f0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 55 aa  |..............U.|
[...]
---

Partition #1 (or is it #4?) decodes as this:
--
Legacy MBR:
    MBR Signature     = aa55
    Unique Signature  = 00000000

    Partition 1:
        Boot Indicator    : non-bootable
        Starting Cylinder =          0
        Starting Head     =          1
        Starting Sector   =          0
        System ID         =       0xee
        Ending Cylinder   =       1023
        Ending Head       =         63
        Ending Sector     =        254
        Relative Sectors  =          1
        Total Sectors     =       6143
--
First, UEFI says the StartingCHS should be set to 0x000200, that should be 0/0/2, not 0/1/0. Second, UEFI says Ending CHS should be set to the CHS address of the last logical block on the disk, _or_ 0xffffff if it's not possible to represent the value in the field. For my 3MB image that value is not correct.






Information forwarded to bug-parted <at> gnu.org:
bug#19137; Package parted. (Fri, 21 Nov 2014 16:03:02 GMT) Full text and rfc822 format available.

Message #8 received at 19137 <at> debbugs.gnu.org (full text, mbox):

From: Håkon Løvdal <hlovdal <at> gmail.com>
To: Ulrich Windl <Ulrich.Windl <at> rz.uni-regensburg.de>
Cc: 19137 <at> debbugs.gnu.org
Subject: Re: bug#19137: mklabel gpt created invalid Protective MBR
Date: Fri, 21 Nov 2014 17:02:40 +0100
On 21 November 2014 08:50, Ulrich Windl
<Ulrich.Windl <at> rz.uni-regensburg.de> wrote:
> GNU Parted 2.3 creates an invalid Protective MBR (for a 3MB test image):

Hi. Version 2.3 is quite old, can you reproduce this with the latest
version, 3.2?

BR Håkon Løvdal




Information forwarded to bug-parted <at> gnu.org:
bug#19137; Package parted. (Fri, 21 Nov 2014 20:16:02 GMT) Full text and rfc822 format available.

Message #11 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "Brian C. Lane" <bcl <at> redhat.com>
To: bug-parted <at> gnu.org
Subject: Re: bug#19137: mklabel gpt created invalid Protective MBR
Date: Fri, 21 Nov 2014 12:15:17 -0800
On Fri, Nov 21, 2014 at 05:02:40PM +0100, Håkon Løvdal wrote:
> On 21 November 2014 08:50, Ulrich Windl
> <Ulrich.Windl <at> rz.uni-regensburg.de> wrote:
> > GNU Parted 2.3 creates an invalid Protective MBR (for a 3MB test image):
> 
> Hi. Version 2.3 is quite old, can you reproduce this with the latest
> version, 3.2?

Same thing happens with 3.2, the code in _write_pmbr is pretty
brain-dead. The SizeInLBA looks correct to me though, 1 less than the
disk length:

pmbr->PartitionRecord[0].SizeInLBA = PED_CPU_TO_LE32 (dev->length -
1UL);

-- 
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)




Information forwarded to bug-parted <at> gnu.org:
bug#19137; Package parted. (Fri, 21 Nov 2014 20:37:02 GMT) Full text and rfc822 format available.

Message #14 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "Brian C. Lane" <bcl <at> redhat.com>
To: bug-parted <at> gnu.org
Subject: Re: bug#19137: mklabel gpt created invalid Protective MBR
Date: Fri, 21 Nov 2014 12:36:27 -0800
On Fri, Nov 21, 2014 at 08:50:24AM +0100, Ulrich Windl wrote:
> GNU Parted 2.3 creates an invalid Protective MBR (for a 3MB test image):
> --
> hexdump -C gptgood
> 00000000  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
> *
> 000001c0  01 00 ee fe ff ff 01 00  00 00 ff 17 00 00 00 00  |................|
> 000001d0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
> *
> 000001f0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 55 aa  |..............U.|
> [...]
> ---
> 
> Partition #1 (or is it #4?) decodes as this:
> --
> Legacy MBR:
>     MBR Signature     = aa55
>     Unique Signature  = 00000000
> 
>     Partition 1:
>         Boot Indicator    : non-bootable
>         Starting Cylinder =          0
>         Starting Head     =          1
>         Starting Sector   =          0
>         System ID         =       0xee
>         Ending Cylinder   =       1023
>         Ending Head       =         63
>         Ending Sector     =        254
>         Relative Sectors  =          1
>         Total Sectors     =       6143
> --
> First, UEFI says the StartingCHS should be set to 0x000200, that should be 0/0/2, not 0/1/0. Second, UEFI says Ending CHS should be set to the CHS address of the last logical block on the disk, _or_ 0xffffff if it's not possible to represent the value in the field. For my 3MB image that value is not correct.

The code has been like this since the beginning of time :) You're right,
the CHS values aren't exactly correct, but given that they have been
that way for a long time, and nothing we know of is having an actual
problem with them, I'm reluctant to change them for fear that there is
firmware in the wild that expects these values.

In my previous email I said SizeInLBA was correct, which isn't what
you were talking about :)

-- 
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)




Information forwarded to bug-parted <at> gnu.org:
bug#19137; Package parted. (Tue, 02 Dec 2014 12:28:02 GMT) Full text and rfc822 format available.

Message #17 received at 19137 <at> debbugs.gnu.org (full text, mbox):

From: "Ulrich Windl" <Ulrich.Windl <at> rz.uni-regensburg.de>
To: <hlovdal <at> gmail.com>
Cc: 19137 <at> debbugs.gnu.org
Subject: Antw: Re: bug#19137: mklabel gpt created invalid Protective
 MBR
Date: Tue, 02 Dec 2014 13:27:21 +0100
>>> Håkon Løvdal <hlovdal <at> gmail.com> schrieb am 21.11.2014 um 17:02 in
Nachricht
<CAACXqO_W_rmbckni-kmndKbB9OMu-z=815PgFbbH_E0aCBLUyw <at> mail.gmail.com>:
> On 21 November 2014 08:50, Ulrich Windl
> <Ulrich.Windl <at> rz.uni-regensburg.de> wrote:
>> GNU Parted 2.3 creates an invalid Protective MBR (for a 3MB test image):
> 
> Hi. Version 2.3 is quite old, can you reproduce this with the latest
> version, 3.2?

parted-3.2 has still the same problems (well, if nobody fixed them):

Legacy MBR:
    MBR Signature     = aa55
    Unique Signature  = 00000000

    Partition 1:
        Boot Indicator    : non-bootable
        Starting Cylinder =          0
        Starting Head     =          1
        Starting Sector   =          0
        System ID         =       0xee
        Ending Cylinder   =       1023
        Ending Head       =         63
        Ending Sector     =        254
        Relative Sectors  =          1
        Total Sectors     =        999
---
There is still the Problem that starting C/H/S is 0/1/0 which does not match
"Relative Sectors", just as Ending C/H/S does not match Relative Sectors +
Total Sectors

> 
> BR Håkon Løvdal







This bug report was last modified 10 years and 200 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.