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?

Peter Westlake
  • 1,076
  • 1
  • 7
  • 17
  • 1
    Is your disk larger than 2.2 TB? – harrymc Sep 28 '18 at 15:51
  • No, it's smaller. I suspect that's what causes the problem, though I can't prove it. – Peter Westlake Sep 28 '18 at 16:54
  • That cannot cause the problem. What disk is it? – harrymc Sep 28 '18 at 16:56
  • A Toshiba DT01ACA050, size 1953525168 sectors, 931.5 GB. If I use gedit to write a new protective MBR, it uses 1953525167 for the end sector, and then the sgdisk save and restore work. – Peter Westlake Sep 28 '18 at 17:09
  • It's worse than you think : The DT01ACA050 gets its name because it has 500 GB. If it had 1 TB, it would be called DT01ACA100 ([link](https://toshiba.semicon-storage.com/us/product/storage-products/client-hdd/dt01acaxxx.html)). Something is very fishy with that disk - it succeeds in misleading operating systems about its capacity. Is it still under warranty? – harrymc Sep 28 '18 at 17:42
  • Sorry, I was looking at the wrong machine! It's an HUS722T1TALA600, which I believe is 1TB. – Peter Westlake Sep 28 '18 at 17:44
  • It's now even worse - see my answer. – harrymc Sep 28 '18 at 17:58
  • Yes, that was the problem I referred to in the question, detailed at the link. So the question is, is there an Windows equivalent of gdisk, that can write a correct protective MBR? – Peter Westlake Oct 01 '18 at 09:05
  • See the addition to my answer. – harrymc Oct 01 '18 at 09:42

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
  • 455,459
  • 31
  • 526
  • 924
  • 1
    Downvote. Why ? – harrymc Sep 28 '18 at 16:02
  • Yeah it's annoying isn't it?! The first time I see one of the "real" super users complain about it. I wish there could be a mandatory (anonymous) reason for the downvote... sigh Maybe I should suggest that in meta?! PS. I wasn't the downvoter... – Albin Sep 28 '18 at 16:15
  • @Albin: Such measures were discussed on Meta but nobody ever agreed on anything. – harrymc Sep 28 '18 at 16:17
  • @Albin - I suggested that a couple of years ago, but it was refused. I'm sure I'm not the only one to have done so. – AFH Sep 28 '18 at 16:19
  • @AFH Thanks I'll do some research. Would you guys be interested in opening a chat room to discuss this further or did you give up on it? – Albin Sep 28 '18 at 16:21
  • @Albin: I gave up a long time ago. Anyway, I think that SU Meta is not the right place for site changes. This is done on a higher level up in the StackOverflow hierarchy. Maybe SO Meta, but the chances are slim. – harrymc Sep 28 '18 at 16:24
  • @Albin - [This](https://meta.superuser.com/questions/8706/penalty-for-unexplained-down-votes) was my submission, which I subsequently accepted was a duplicate, but I received a couple of interesting comments before the duplicate was flagged, which is why I haven't quoted the duplicate. – AFH Sep 28 '18 at 16:39
  • @AFH: Interesting and convincing of the futility. – harrymc Sep 28 '18 at 16:50