Windows – Create hybrid MBR/GPT just like Bootcamp Assistant does

bootcamppartitionwindows

Currently I have two partitions with data on them I would like to keep (marked with a *):

/dev/disk0 (internal, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *250.1 GB   disk0
   1:                        EFI EFI                     209.7 MB   disk0s1
   2:                  Apple_HFS Macintosh SSD*          164.2 GB   disk0s2
   3:                 Apple_Boot Recovery HD             650.0 MB   disk0s3
   4:                  Apple_HFS Additional_Storage*      56.6 GB   disk0s4
   5:       Microsoft Basic Data                          28.4 GB   disk0s5

Now I would like to install Windows on /dev/disk0s5. However, since the partition is GPT Windows cannot be installed. Is there a way to create my own MBR/GPT hybrid like the Bootcamp-Assistant does? /dev/disk0s5 would then be MBR and the rest still GPT.

Output of sudo fdisk /dev/disk0:

Disk: /dev/disk0    geometry: 30401/255/63 [488397168 sectors]
Signature: 0xAA55
         Starting       Ending
 #: id  cyl  hd sec -  cyl  hd sec [     start -       size]
------------------------------------------------------------------------
 1: EE 1023 254  63 - 1023 254  63 [         1 -  488397167] <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  

Output of sudo 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  320702320      2  GPT part - 48465300-0000-11AA-AA11-00306543ECAC
  321111960    1269536      3  GPT part - 426F6F74-0000-11AA-AA11-00306543ECAC
  322381496        328         
  322381824  110616584      4  GPT part - 48465300-0000-11AA-AA11-00306543ECAC
  432998408       2040         
  433000448   55396352      5  GPT part - EBD0A0A2-B9E5-4433-87C0-68B6B72699C7
  488396800        335         
  488397135         32         Sec GPT table
  488397167          1         Sec GPT header

My system:

MacBook Pro 2011, OS X El Capitan

Best Answer

The problem is not that you don't have an MBR. The problem is that an MBR can only have 4 partition entries. On an out-of-the-box fresh install of OS X, you'd be using 3 of those partition entries already; one for the EFI partition, one for the Mac HFS partition, and one for the recovery partition. That leaves only one MBR slot available for the Boot Camp Assistant to work with in order to install Windows.

In your situation, you have an additional Data partition called "Additional Storage" that is taking up the 4th slot. Since your Windows partition is the 5th partition on the disk, the MBR cannot handle this, nor does the Boot Camp Assistant know what to do in this scenario, so it refuses to work.

The solution is to manually use fdisk to make your partition table look like this:

Disk: /dev/disk0    geometry: 30401/255/63 [488397168 sectors]
Signature: 0xAA55
         Starting       Ending
 #: id  cyl  hd sec -  cyl  hd sec [     start -       size]
------------------------------------------------------------------------
 1: EE 1023 254  63 - 1023 254  63 [         1 -     409639] <Unknown ID>
 2: AF 1023 254  63 - 1023 254  63 [    409640 -  320702320] HFS+
 3: AB 1023 254  63 - 1023 254  63 [ 322381824 -  110616584] HFS+
 4: 07 1023 254  63 - 1023 254  63 [ 433000448 -   55396352] HPFS/QNX/AUX

What I have done here is used the sector numbers from your output of the gpt command to show you what your MBR partition table should look like. If you look closely, I have omitted the recovery partition from the table (since it's generally useless and you'd likely want to access your Additional Storage partition while running Windows).

To make these changes, use fdisk -e /dev/disk0 to enter fdisk in interactive mode. You can issue a ? command to get a list of the available commands you'll need to do the modifications.

Also, when fdisk asks you if you want to edit in CHS mode, say no. Don't worry about the cyl/hd/sec values. They won't have the same numbers for you as they do in my table above, but it doesn't matter.


A few words of warning here:
This layout is horribly unsupported by both Apple and Windows. Having the GPT and MBR partition tables disagree with each other is an error as far as OS X is concerned, and there is a 650MB gap between partitions 2 and 3 as far as Windows is concerned.

  1. Do not EVER under ANY circumstances use any partitioning tools to adjust/repartition your disk from this point on. Best case scenario: it'd just give you an error. Worst case scenario: it'd destroy the entire disk.
  2. Make sure you do not use Disk Utility to "repair" your disk. Always make sure you have a partition selected when doing First Aid, not the disk itself.
  3. Do not use whole-disk encryption software (BitLocker or FileVault). These require additional support partitions and will attempt to repartition the drive.
  4. Do not convert your disks to Dynamic (Windows) or CoreStorage (Mac) volumes. These will modify the partition tables also.