3

I have a UEFI machine with CentOS on one disk and Windows 2016 on another. The Windows installer writes the GPT protective MBR, but it doesn't follow the UEFI standard exactly, as described here. It writes the MBR with a single partition, as per standard, but then it makes the last sector 2^32-1 instead of the actual size of the disk.

This isn't a problem until I try to use sgdisk to save the partition table and later restore it. The bad figure for the size confuses things and it ends up with a corrupt MBR. In CentOS, I can prevent this by using gdisk to write a new protective MBR. However, it would be convenient if I could do that from Windows. Is there a way?

1 Answers1

3

As the poster's disk is just 1 TB, my answer below does not apply.

I discovered a very surprising fact in the article The GPT Protective MBR and Partition Table:

Windows 7 always fills this field with 0xFFFFFFFF, even though the UEFI Specification states this should be "set to the size of the disk minus one" for drives under 2.2 TB.

And this is what is noted in a footnote :

Reference and full quote: Unified Extensible Firmware Interface Specification, Version 2.3.1, Errata C, June 27, 2012, which states in Chapter 5, GUID Partition Table (GPT) Disk Layout, Section 5.2.3, Protective MBR, Table 15, 'SizeInLBA', on page 100: "Set to the size of the disk minus one. Set to 0xFFFFFFFF if the size of the disk is too large to be represented in this field." Since Microsoft uses the same entry for drives smaller than 2.2 TB as it does for those over 2.2 TB, they are not following the UEFI Specification for SizeInLBA.

So this is a case of Microsoft deciding to ignore the standard, and there is nothing you can do about it. A solution might possibly be to do the partition allocation under Linux.

If you are looking for a non-Microsoft utility under Windows, see the article Best Free Partition Management Software, which lists free third-party utilities which may not ignore the standard.


(Old answer)

I think that your disk must be larger than 2.2 TB, which is the maximum size for an MBR.

The protective MBR (or any MBR) is limited to that size. It cannot give a larger number, because the field in the MBR that contains the partition size has only 32 bits.

This limitation was one of the reasons that GPT became necessary when disks larger than 2.2 TB arrived on the market.

harrymc
  • 498,455