Hacker News new | ask | show | jobs
by skissane 392 days ago
MBR and GPT can coexist on the same disk - MBR goes in sector 0, GPT starts in sector 1. Normally the MBR in sector 0 is “protective” (it just marks the whole disk as in use), but in theory you can create a “hybrid” disk in which the MBR and GPT both describe the same partitions. I suppose you could even reserve most of the disk as one big GPT partition and then split that up into multiple MBR partitions. You’d have to be very careful editing the partition table on such a disk because standard tools might break it.
1 comments

In practice, whether or not this actually works can be very hit-or-miss. We've found several UEFI implementations will not consider a disk bootable if the pMBR doesn't exactly match the spec, which specifies that the 'protective' partition shouldn't be marked as bootable in the MBR partition table.

Meanwhile, other implementations will not consider the disk bootable in BIOS mode if the partition in the pMBR is not marked bootable.

Indeed! Which is why the only portable solution is to not do this.

For stuff that needs to be bootable by both BIOS and UEFI the only portable solution is to use MBR, not GPT. That means all legacy BIOS systems will boot it, and so will all UEFI systems since UEFI must support MBR.

For ISOs that need to additionally be booted off of optical media (aka ISOHYBRIDs) the story gets more complicated, but ultimately what you need to take away from that is the same: avoid GPT at all cost.

I wonder… does the UEFI spec mandate any particular behaviour in these cases? Does the UEFI SCT test for it?

Seems like an inconsistency which could be addressed by adding it to the spec and/or test suite.

I guess the other thing I don’t know, is whether there is any actual real world pressure on firmware vendors to pass the test suite.