Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

murphychris

macrumors 6502a
Original poster
Mar 19, 2012
661
2
From Apple's Bootcamp 5 FAQ:
How can a Windows partition be resized after Windows is installed?

You need to delete the Windows partition using the Boot Camp Assistant, and start over to change the size of the Windows partition. Back up your important Windows files first.

If you have resized your Windows partition contrary to this instruction, by using Disk Utility to shrink OS X, and then rebooting to Windows to resize Windows into the newly created free space, you will invariably experience the loss of Windows upon upgrading (to 10.7, 10.8 or 10.9). By loss, I mean, it will vanish. It will not appear in OS X's Finder. And it will not be bootable.

You can find numerous examples of post install data loss on this forum for those versions of OS X at the times they were released, it's happening again now with 10.9. There are numerous examples of this on Apple's forums as well, including this 52+ page thread.

So if you have resized your Windows volume first using Disk Utility, then using a Windows utility; rather than doing as the FAQ above says or using a 3rd party utility explicitly designed for Bootcamp volume resizing like iPartition, Camptune, or Winclone, your Windows data is at risk if you upgrade.

The simplest way to solve this problem is to back up both OS X and Windows environments, and prepare to completely reformat the disk. By that I mean complete removal of both OS X and Windows; install 10.9; use Bootcamp Assistant to repartition the disk; restore your OS X data; reinstall Windows making sure you reformat the new partition in the Windows installer first; and then restoring your Windows user data.

A PITA. But it's a lot easier than the alternative which is 100% done only in the command line interface as you can see from the Apple forum thread.

For the more technical folks, you can avoid the above if you understand the following. Windows on Apple hardware boots using CSM/BIOS mode, which means Windows only honors MBR partition maps. It totally ignores the GPT. OS X uses the GPT of course. When using Disk Utility the MBR and GPT to resize OS X to create free space, the two were still sync'd to contain the same information. Upon resizing in Windows, only the MBR was updated with the partition size change. So only the MBR has the correct information. Upon upgrading OS X the installer does a disk repair that includes checking the GPTs, and when it finds the MBR and GPT disagree it stomps on the MBR and replaces its data with the wrong data in the GPT. So the MBR now has the old partition entry for Windows before the resize. Once that MBR entry containing the correct start and end sector value is gone, it's gone. A copy isn't saved anywhere. So now you have to use specialized recovery software like testdisk to find the correct start of the Windows volume...

If you have a fusion drive or a disk bigger than 2TB, ignore all of this, different instructions apply entirely.

To avoid starting from scratch: Google gpt fdisk, and download the current version of gdisk from sourceforge.org, which is currently 0.8.8. Install it. At the command line you need to type:
Code:
sudo fdisk /dev/rdiskX

X = the number of the physical disk, which is usually 0. You can get it from the command 'diskutil list'.

This will list the contents of the MBR, which contains the correct partition information, in particular for the 4th partition. Keep this information in one window and in separate one run gdisk:
Code:
sudo gdisk /dev/rdiskX

Type ? and <return> to see the current menu. Any changes you make are in memory only, they don't affect ondisk information until you use the w command. So if you think you've messed something up you can q to quit without changes, or command-c to force quit.

Type p to "print" the current GPT. Compare partition 4 in the GPT to the fdisk result and you'll realize there's a huge gap of free space between partition 3 and 4 in the GPT. That's your free space from Disk Utility, but GPT partition 4 wasn't update by the Windows resize utility. So you need to delete the partition 4 entry in the GPT using gdisk, and then create a new partition using the start and end values from fdisk partition 4. NOTE that fdisk reports a start column which is what you'll use in gdisk for "First sector". However fdisk reports size, not end sector. So you have to add the start and size column values from fdisk, and plug that number into gdisk when it asks for the Last sector value. For the type code you will use 0700 which translates into the partitiontypeguid for Microsoft basic data.

Now while still in gdisk go to the recovery menu by typing r, do make sure you're in the recovery menu, the gdisk prompt will tell you if you are it says:

Recovery/transformation command (? for help):

So when you're in that menu, type p and then type o. That will display the GPT contents and the MBR contents. Compare them and make sure they're the same, in particular partition 4. If they are, write out the partition maps with the w command, and then reboot.

Now when you upgrade to 10.9, the installer won't blow away the MBR and replace it with wrong information and Windows will still be around after the upgrade.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.