in the same vein of zeroing the mbr

Jan 11, 2009 21:45

"How to resize your Mac's hard drive after realizing you need more space in OS X and less in linux/windows"

0) Do a backup. Right now. Doesn't matter how. Time Machine makes it pretty easy.
1) Don't zero your mbr (early December was quite an adventure)
2) Apple's DiskUtility and diskutil don't work ("MediaKit reports partition (map) too small", "the device does not support the resize operation", etc). gpt might but I was too afraid to use it.
The problem is that the OS X tools don't work on drives with an MBR, just with a GPT. (There's a reason item #1 is on this list...I went down that path.)
3) gparted live cd. parted has a bug, where it favors the guid partition table and trashes the master boot record when you create a partition on a hybrid gpt/mbr drive. parted also has a problem growing hfs+ partitions (but no problems shrinking or creating them, which we're going to take full advantage of).

4) Boot the gparted live cd. Shrink your linux/windows partition. Shove it to the end of the drive so there's free space between the OS X partition and the linux/windows partitions.
5) parted can't grow hfs+ drives, remember? So create a new hfs+ partition between the OS X one and the other OS. Reboot.
6) If you're using rEFIt (which probably means "you're using linux"), don't start the rEFIT partitioning tool. Don't run gptsync. Boot straight into OS X. Right now, you have a GPT-only drive, and the Apple tools will work.
7) Open up a terminal window. "diskutil list" should tell you the id of the partitions you want to play with. They should not have any other partitions between them. 'diskutil mergePartitions "Journaled HFS+" "Macintosh HD" /dev/disk0s2 /dev/disk0s4' (or something like that, /dev/disk0s2 is your Mac OS X partition, and /dev/disk0s4 is your newly-created hfs+ partition).

If all goes well, you've got a bunch more free space in your OS X partition. hooray!
now you can gptsync or whatever you want. Me? I'm going to enjoy knowing how to do this the next time I need to.

personal, technology

Previous post Next post
Up