You've followed some
how-to's online and setup your MacBook Pro to dual boot OSX/Ubuntu. Now you realize that you never use Ubuntu and really want that space back on your OSX partition so that you can keep downloading episodes of The Office. Well it's not as easy as it sounds.
It was a long process but I finally got that sucker off of my laptop. I found a lot of stuff on the internet about resizing* an HFS+ partition but basically only Bootcamp and commercial software can do it. The most important piece of information in the post is at the very end, about restoring a backup image using the OSX install disk.
What Doesn't WorkBootcamp - Normally what a user does is repartition their drive with Bootcamp, install Windows, gets bored, then uses Bootcamp to delete the Windows partition and have their OSX partition take back the space. If you alter the partitions at all after running the Bootcamp utility to repartition your drive you cannot use Bootcamp to restore it. It will display a message telling you that it cannot recognize the Windows partition and then exit.
Disk Utility - This program is pretty much useless. It won't let you alter any partition that it doesn't understand and just about the only type it does understand is HFS+.
GParted - I found this great utility for repartitioning drives. Too bad it doesn't support resizing of HFS+ partitions.
Tricking Bootcamp - I used GParted to reformat the linux partition to FAT32 and NTFS but try as I may, I couldn't trick Bootcamp into thinking that there was a Windows partition that needed removing.
What Does WorkThese are the steps I went through to completely restore my computer back to working order, complete with the stupid things that don't work that'll drive you crazy trying to figure out.
Preparing the USB Drive For the Backup
Most USB drives are formatted to FAT32 because both Windows and Macs can read/write to it. Too bad FAT32 doesn't support large files.
- Boot up using GParted
- Shrink the FAT32 partition to make room for another partition that is LARGER than the amount of data that is on your OSX partition.
- Boot up using the OSX install disk and run Disk Utility to create a new HFS+ partition on the USB disk from the free space.
How to Make the Backup- Boot up using the OSX install disk
- Click on the OSX partition you want to back up (probably called "Macintosh HD")
- Click "New Image" and save to the partition on your external USB device that you just created.
RepartitioningAny changes you make to your partition table using Disk Utility WILL indeed erase all the data on it. It is not lying when it warns you of this fact. Just delete the extra partition and make the OSX one as big as you can.
How to Restore the Backup
This is probably the most annoying part of the whole thing. You see there is a
problem with the version of Disk Utility that comes on the Intel OSX install disks. Basically you can't use it to restore a backup. Damn them!
- Using Disk Utility, mount your backup image
- Quit Disk Utility and open up the Terminal
- Type in the following commands
- cd /Volumes/{mounted backup}/Applications/Utilities
- cp "Disk Utility.app" /Volumes/{usb backup}/
- Replace {mounted backup} with the name of the partition image, probably something like "Macintosh HD 1" and replace {usb backup} with the name of the HFS+ partition on your USB drive.
- Quit Terminal and open Disk Utility
- Unmount the backup image
- Quit Disk Utility and open up Terminal
- Run the new Disk Utility program
- cd /Volumes/{usb backup}/"Disk Utility.app"/Contents/MacOS
- Now you can properly restore the disk image
- just select the partition you want to restore
- click "Restore" and drag the partition to "Destination"
- click "Image..." and select your backup
- You're Done! Reboot and enjoy.
Basically to restore your backup you just need a working version of Disk Utility. You could do this multiple ways other than retrieving it from your backup image. It would probably make more sense to copy it over to your usb drive before you started trying to mess with partitioning at all.
*One method to resize an HFS+ partition I cam across was to use the command diskutil resizeVolume but I was unable to get this to work.
