Hello,

Could someone with knowledge in architectures that use the GPT disk labels
please have a look at this, and tell me if it is worthwhile to add this patch ? 

Friendly,

Sven Luther

----- Forwarded message from Matt Domsch <[EMAIL PROTECTED]> -----

Envelope-to: [EMAIL PROTECTED]
Delivery-date: Mon, 08 Nov 2004 18:05:59 +0100
X-Sieve: Server Sieve 2.2
From: Matt Domsch <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: [PATCH] GPT PMBR disk >2TB fix
X-BeenThere: [EMAIL PROTECTED]
X-Mailman-Version: 2.1.5
List-Id: Bug reports for the GNU Parted disk partition editor
        <bug-parted.gnu.org>
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/bug-parted>,
        <mailto:[EMAIL PROTECTED]>
List-Archive: <http://lists.gnu.org/pipermail/bug-parted>
List-Post: <mailto:[EMAIL PROTECTED]>
List-Help: <mailto:[EMAIL PROTECTED]>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/bug-parted>,
        <mailto:[EMAIL PROTECTED]>
X-Spam: no; 0.00; fix:01 mbr:01 xffffffff:01 efi:01 overflowing:01 2.6.10:01 
linux:01 kernel:01 partitioning:01 xffffffff:01 linux:01 parted-:01 
libparted:01 wed:01 parted-:01 

Patch below (applies against 1.6.11 and 1.6.16 at least) sets the
SizeInLBA field in the Protective MBR on GPT disks to be 0xFFFFFFFF if
the disk size is really larger than that.  This is to be consistent
with the EFI Specification.

Necessary to prevent overflowing this field on really large disks.
The 2.6.10 Linux kernel partitioning code will start checking
this value for sanity, and 0xFFFFFFFF is a special value there now.


-- 
Matt Domsch
Sr. Software Engineer, Lead Engineer
Dell Linux Solutions linux.dell.com & www.dell.com/linux
Linux on Dell mailing lists @ http://lists.us.dell.com


--- parted-1.6.11/libparted/disk_gpt.c~ Wed Mar 10 16:11:42 2004
+++ parted-1.6.11/libparted/disk_gpt.c  Mon Nov  8 09:37:17 2004
@@ -689,7 +689,10 @@ _write_pmbr(PedDevice * dev)
        pmbr.PartitionRecord[0].EndSector   = 0xFF;
        pmbr.PartitionRecord[0].EndTrack    = 0xFF;
        pmbr.PartitionRecord[0].StartingLBA = PED_CPU_TO_LE32(1);
-       pmbr.PartitionRecord[0].SizeInLBA   = PED_CPU_TO_LE32(dev->length - 1);
+       if ((dev->length - 1ULL) > 0xFFFFFFFFULL) 
+               pmbr.PartitionRecord[0].SizeInLBA = PED_CPU_TO_LE32(0xFFFFFFFF);
+       else
+               pmbr.PartitionRecord[0].SizeInLBA = PED_CPU_TO_LE32(dev->length 
- 1UL);
 
        return ped_device_write(dev, &pmbr, GPT_PMBR_LBA, GPT_PMBR_SECTORS);
 }


_______________________________________________
Bug-parted mailing list
[EMAIL PROTECTED]
http://lists.gnu.org/mailman/listinfo/bug-parted

----- End forwarded message -----


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to