Previous versons of OS X and macOS automatically converted pure GPT drives to hybrid GPT/MBR format when the 2nd, 3rd, and/or 4th GPT partitions were formatted "MS DOS (FAT)" by the Disk Utility application or the diskutil
command. I am not sure when this changed, but this no longer happens under High Sierra (macOS 10.13.2).
My Mac needs the hybrid format in order to BIOS boot the installed Windows operating system.
What is a procedure to manually convert the drive back to the hybrid format?
Below is the output from the command diskutil list disk0
.
/dev/disk0 (internal, physical):
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *500.0 GB disk0
1: EFI EFI 209.7 MB disk0s1
2: Apple_APFS Container disk1 249.5 GB disk0s2
3: Microsoft Basic Data BOOTCAMP 200.0 GB disk0s3
4: Microsoft Basic Data COMMON 50.0 GB disk0s4
5: Apple_HFS Refind 200.0 MB disk0s5
The BOOTCAMP volume is NTFS formatted and the COMMON volume is FAT32 formatted.
Note: The next two commands were executed after starting up from macOS Recovery.
Below is the output from the command gpt -r show /dev/disk0
.
start size index contents
0 1 PMBR
1 1 Pri GPT header
2 32 Pri GPT table
34 6
40 409600 1 GPT part - C12A7328-F81F-11D2-BA4B-00A0C93EC93B
409640 487304680 2 GPT part - 7C3457EF-0000-11AA-AA11-00306543ECAC
487714320 496
487714816 390623232 3 GPT part - EBD0A0A2-B9E5-4433-87C0-68B6B72699C7
878338048 2048
878340096 97654784 4 GPT part - EBD0A0A2-B9E5-4433-87C0-68B6B72699C7
975994880 696
975995576 390616 5 GPT part - 48465300-0000-11AA-AA11-00306543ECAC
976386192 176315
976562507 32 Sec GPT table
976562539 1 Sec GPT header
Below is the output from the command fdisk /dev/disk0
.
Disk: /dev/disk0 geometry: 60788/255/63 [976562540 sectors]
Signature: 0xAA55
Starting Ending
#: id cyl hd sec - cyl hd sec [ start - size]
------------------------------------------------------------------------
1: EE 1023 254 63 - 1023 254 63 [ 1 - 976562539] <Unknown ID>
2: 00 0 0 0 - 0 0 0 [ 0 - 0] unused
3: 00 0 0 0 - 0 0 0 [ 0 - 0] unused
4: 00 0 0 0 - 0 0 0 [ 0 - 0] unused
Best Answer
Here, I assume you are using High Sierra (macOS 10.13.2).
To update the MBR partition table, a mapping of the partition types needs to be known. Below is a table of some commonly found types.
Here are the methods involving in editing the MBR table to create a hybrid partitioning scheme.
Method 1: Use the Third Party Tool
gdisk
While booted to macOS, download and install
gdisk
.Disable SIP and then boot back to macOS. This will allow you to use the commands
gpt
,gdisk
andfdisk
. You also can executegpt
,gdisk
andfdisk
from macOS Recovery, but this may require you to precede thegdisk
command with a path.The command given below can be used to partially display the information contained in GPT stored on
disk0
. You will need this information verify the changes made to the MBR table. (See the above question for the output from this command.)Enter the command given below.
Enter the input given below. This input is correct for the drive used as an example in this answer. Your actual input may vary from what is shown.
Below is an example of the output after entering the command and the above input.
As the above message suggests, it would be a good idea to restart the Mac.
Enter the command given below to verify the changes.
Below is an example of the output after entering the command. Except for the
start
value of partition1
, the remainingstart
andsize
values should match the output from thegpt -r show /dev/disk0
command.If desired, enable SIP.
Method 2: Use No Third Party Tools
Unless you disable System Integrity Protection (SIP), the solution given below requires booting to macOS Recovery via the internet, built-in recovery or an USB flash drive macOS installer. Once booted to macOS Recovery, open a Terminal application window.
The command given below can be used to partially display the information contained in GPT stored on
disk0
. You will need this information when editing the MBR table. (See the above question for the output from this command.)The interactive command to edit the MBR partition table is given below. All changes will be not be entered in CHS mode.
Entering this command produced the following output
The only entry, in the initial MBR table, defines a "Protective Partition". This partition needs to be truncated to the end of the first partition in the GPT with the GUID of
C12A7328-F81F-11D2-BA4B-00A0C93EC93B
. This means thestart
value should remain1
, but thesize
value should be reduced to the valuestart
+size
-1
. The values use in this equation should be taken from GPT. Below is the resulting output from using theedit
command to reduce the size of the first MBR partition.Next, enter the correct values for partition 2. The command is
enter
and theid
isAF
. Thestart
andsize
values are the same as shown in the GPT. Doing so, results in what is shown below.Repeat the previous step to update partitions 3 and 4. This is shown below. The
id
for partition 3 is07
and for partition 4 is0C
.The next command flags the third partition as bootable. This partition was chosen because this is where the Windows resides.
The next command to enter is
print
. This command displays what the updated MBR table would look like. The result is shown below. You can use the output to verify your changes. Except for thestart
value of partition1
, the remainingstart
andsize
values should match the output from thegpt -r show /dev/disk0
command.The final command
quit
writes the table back to the MBR, then quitfdisk
. This is shown below.As the above message suggests, it would be a good idea to restart the Mac.
If desired, enable SIP.