[parted-devel] [PATCH] libparted: Fix ending CHS address in PMBR.

Ulrich Müller ulm at gentoo.org
Sat Jul 14 08:09:31 BST 2018


According to the UEFI specification version 2.7, Section 5.2.3,
Table 16, the ending CHS address in the protective MBR should be set
to 0xFFFFFF. This also agrees with the behaviour of fdisk from
util-linux-2.32.
---
 libparted/labels/gpt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libparted/labels/gpt.c b/libparted/labels/gpt.c
index 4f922b2..6f92a34 100644
--- a/libparted/labels/gpt.c
+++ b/libparted/labels/gpt.c
@@ -1144,7 +1144,7 @@ _write_pmbr (PedDevice *dev, bool pmbr_boot)
   pmbr->Signature = PED_CPU_TO_LE16 (MSDOS_MBR_SIGNATURE);
   pmbr->PartitionRecord[0].OSType = EFI_PMBR_OSTYPE_EFI;
   pmbr->PartitionRecord[0].StartSector = 2;
-  pmbr->PartitionRecord[0].EndHead = 0xFE;
+  pmbr->PartitionRecord[0].EndHead = 0xFF;
   pmbr->PartitionRecord[0].EndSector = 0xFF;
   pmbr->PartitionRecord[0].EndTrack = 0xFF;
   pmbr->PartitionRecord[0].StartingLBA = PED_CPU_TO_LE32 (1);
-- 
2.18.0



More information about the parted-devel mailing list