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).
- Boot from OS X install media and open up a command prompt.
- 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. - Type
diskutil unmountDisk /dev/disk0
This will unmount the disk so GPT can write to it. - Type
gpt remove -i 4 /dev/disk0
NOTE that the '4' here references the partition number of your Windows partition you got fromfdisk
earlier. This will delete the GPT partition entry for your Windows partition (but not the MBR entry) - Type
fdisk -d /dev/disk0 >/Volumes/fdisk.txt
This will make a backup of the MBR partition table. -
Type
fdisk -e /dev/disk0
This will put thefdisk
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 fromfdisk
earlier. This will delete the MBR partition entry for your Windows partition.e 4 0 q y
- Type
diskutil unmountDisk /dev/disk0
again because thegpt
command caused OS X to remount the disk and we need to modify it again. - 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 thefdisk
command earlier. - For good measure, type
gpt show /dev/disk0
to view the GPT table. Make sure the partition number, start sector, and size match thefdisk
output from step 2 EXACTLY. - Type
diskutil unmountDisk /dev/disk0
again because thegpt
command caused OS X to remount the disk and we need to modify it again. - Type
fdisk -r -y /dev/disk0 </Volumes/fdisk.txt
This will undo the changes made in step 6. - For good measure, type
fdisk /dev/disk0
to view the MBR table. Make sure the output matches thefdisk
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.