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 Work
Bootcamp - 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 Work
These 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.
- 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.
Any 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
- ./Disk\ Utility
- 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.
*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.

4 comments:
Thank you so much for posting this tutorial. I had the same problem.
One slight mistake I found was that for the terminal command for copying Disk Utility.app, since the app is a directory, the command should be:
cp -R "Disk Utility.app" /Volumes/{Usb backup}/
Thanks!
Actually, the problem can be solved much more easily. If you delete the Windows partition with GParted and resize your Mac partition with Disk Utility, your problem is solved.
The problem with resizing the Mac partition after removing the Ubuntu partition is that Disk Utility doesn't let you resize without erasing the entire partition.
@Alltruist: what Rukgo said works just fine. I've just booted with Ubuntu LiveCD and removed Linux partition using GParted. Then booted with OS X Leopard CD and resized hard disk with Disk Utility. Now, only have OS X. Without loosing any data (ie, without formating entire partition). Really, was that easy. So happy! :)
Post a Comment