Friday, 21 November 2014

Resizing a Bootcamp partition

Took about two days...

Instructions followed: 

This is possible using only free tools. I just did it and wanted to share the solution.
Let's assume that you have a bootcamp setup that you are happy with, with the exception that you need a larger Windows partition (in my case, I made the windows partition 32G, and it wasn't big enough). This may work the other way around, but I can't confirm it.
Software Links:
Short Instructions
  1. Get a windows install disk and [Gparted] and [rEFIt] livecds.
  2. Use gparted to resize the partitions
  3. Use rEFIt to fix the partition boot record
  4. Use the windows install disk to repair the windows partition
  5. Reboot into Windows for a disk check and done
Note: if rEFIt doesn't work for you, the more recent rEFInd project might (google for refind efi). I would post the link here but I am not allowed.
Detailed Instructions
Note: Get to the Mac bootable media list by holding down "Option" on reboot. If you want to eject a CD when you are there, hold down the "eject" button.
  1. Gather the tools. You will need: [Gparted], [rEFIt], and a Windows Install Disk (more specifically, the recovery ability).
    1. Burn the Gparted and rEFIt images to bootable media (either CD, DVD, or USB).
  2. Boot into Gparted by restarting the Mac, holding down "Option", when the bootable media list appears, insert the gparted disk and wait for the gparted media to show up as a boot option. Note, in my system the CD was labeled "Windows". Click the Arrow under it.
    1. Choose Gparted Live as the boot option.
    2. Unless you know what the questions are asking, leave the default start options (for keymap, language and such).
    3. When the GUI appears, resize the HFS+ (Mac) partition, and click the "Resize/Move" button, it will add a task for the resize to the list.
    4. Then resize the NTFS (Windows) partition, and click the button again.
    5. "Apply" the results. This can take a while depending on how much data the partition tool needs to move.
    6. Double click the red exit button in Gparted, then choose reboot from the menu (it takes longer than you think). Gparted will eject the disk (if you used a CD) before rebooting. Go to the Mac bootable list again. Note: this time when you reboot, the windows disk will probably not be present in the bootable disk screen!
  3. Insert the rEFIt media. Wait for it to appear in the bootable disk list, and choose it.
    1. Use the left and right arrow keys to select the "Start Partition Tool" option. It will ask you if you want to update the boot record. Type "Y".
    2. Reboot again holding down the option key.
  4. When the list appears (the windows disk should be back again, but don't choose it yet!), hold down the "eject" key to eject the rEFIt disk, and then insert the Windows install cd. Boot to the install CD.
    1. Choose the language and when the choice appears, pick "Repair Windows Install". It will repair and then reboot. Hold down the option key one last time.
  5. Choose to boot into the Windows disk (not the CD). You should get a menu that asks if you want to Boot windows Normally (yes). Then it will do a disk check, and boot you into windows.
Throughout this whole process, the Mac partition (disk) should remain bootable. You can boot into it periodically if you wish.

___________________________
Notes: 
- I couldn't get rEFIt to boot from the USB - when I tried to manually install it on the key, I got a Permission denied or some such error. Had to install it on the internal drive that was being repartitioned.
- I had to go through the process from GParted (step 2) onwards a couple of times before the Windows CD would recognize and repair the partition correctly.
- Some of the steps (i.e. repartitioning) take a looooooong time.