Bootcamp won't start after resizing partition

My system is divided in two and shared using Boot Camp feature. Recently I needed more space on the Mac partition and whiled loaded only in the Windows partition, I have shrank my Windows partition by 10 Gb using Windows disk management tool.

Now I can no longer start up the Boot Camp bridge while in the Mac OS X side to access the Windows partition. I suspect the Boot Camp file no longer recognize this modified Windows partition.

Is there a quick to solve this issue without having to reinstall everything?


This error occurred because in a Boot Camp setup, your hard drive has a hybrid GPT/MBR partition table, which is unsupported by Microsoft. When you resized the partition in Windows, it only modified the MBR partition table because it was unaware that the GPT table existed. You now have a situation where the GPT partition table and the MBR partition table disagree about the start/end boundaries of the Windows partition.

To fix this, you will need to use the gpt command line tool, and for that you must boot from OS X install media (either a USB flash drive, or Internet Recovery if your model supports that feature -- the recovery partition will not work for this).

  1. Boot from OS X install media and open up a command prompt.
  2. Type fdisk /dev/disk0 to see the MBR partition table. Write down the partition number (it's usually 4), the start sector, and the size of the Windows partition. The start sector and size will be big numbers so make sure you write them down correctly. This is critical.
  3. Type diskutil unmountDisk /dev/disk0 This will unmount the disk so GPT can write to it.
  4. Type gpt remove -i 4 /dev/disk0 NOTE that the '4' here references the partition number of your Windows partition you got from fdisk earlier. This will delete the GPT partition entry for your Windows partition (but not the MBR entry)
  5. Type fdisk -d /dev/disk0 >/Volumes/fdisk.txt This will make a backup of the MBR partition table.
  6. Type fdisk -e /dev/disk0 This will put the fdisk command in interactive edit mode. You will need to enter the following input.
    NOTE that the '4' here references the partition number of your Windows partition you got from fdisk earlier. This will delete the MBR partition entry for your Windows partition.

    e 4
    0
    q
    y
    
  7. Type diskutil unmountDisk /dev/disk0 again because the gpt command caused OS X to remount the disk and we need to modify it again.
  8. Type gpt add -b <start sector> -s <size> -i 4 -t windows /dev/disk0 where 'start sector', 'size', and '4' are the values you wrote down from the fdisk command earlier.
  9. For good measure, type gpt show /dev/disk0 to view the GPT table. Make sure the partition number, start sector, and size match the fdisk output from step 2 EXACTLY.
  10. Type diskutil unmountDisk /dev/disk0 again because the gpt command caused OS X to remount the disk and we need to modify it again.
  11. Type fdisk -r -y /dev/disk0 </Volumes/fdisk.txt This will undo the changes made in step 6.
  12. For good measure, type fdisk /dev/disk0 to view the MBR table. Make sure the output matches the fdisk output from step 2 EXACTLY.

You have now repaired your GPT table. You should be able to reboot the Mac into either operating system now.