Whats the best way to resize Macintosh HD? Disk Utility won't let me resize it whether I'm live resizing from the tool running on my Mountain Lion install or if I boot into Recovery HD so the OS isn't running.

5 Answers
5

Please please make sure that you type in the correct partitions. Double-check and triple check before running the merge command. It’s really important that you backup all of your data. I’m not taking any responsibility if you manage to erase anything. You will not want to lose data if there’s a sudden loss of power mid-operation.

You’ll want to merge disk0s2 with disk0s3. So you’d run something like this:

diskutil mergePartitions JHFS+ DiskName disk0s2 disk0s3

Beware that the above will merge partitions between disk0s2 and disk0s3. Data on disk0s2 is preserved, data on all the partitions in-between is erased. In my example the two partitions are contiguous so there’s no problem. But if your recovery partition is in between it will be erased.

Merge two or more pre-existing partitions into one. The first disk
parameter is the starting partition; the second disk parameter is the
ending partition; this given range of two or more partitions will be
merged into one.

All partitions in the range, except for the first one, must be
unmountable.

All data on merged partitions other than the first will be lost; data
on the first partition will be lost as well if the "force" argument is
given.

If "force" is not given, and the first partition has a resizable file
system (e.g. JHFS+), it will be grown in a data-preserving manner,
even if a different file system is specified (in fact, your file
system and volume name parameters are both ignored in this case). If
"force" is not given, and the first partition is not resizable, you
will be prompted if you want to erase.

If "force" is given, the first partition is always formatted. You
should do this if you wish to reformat to a new file system type.

Merged partitions are required to be ordered sequentially on disk. See
diskutil list for the actual on-disk ordering; BSD slice identifiers
may in certain circumstances not always be in numerical order but the
top-to-bottom order given by diskutil list is always the on-disk
order.

Ownership of the affected disk is required.

Example: diskutil mergePartitions JHFS+ NewName disk3s4 disk3s7
This example will merge all partitions BETWEEN disk3s4 and disk3s7,
preserving data on disk3s4 but destroying data on disk3s5, disk3s6,
disk3s7 and any invisible free space partitions between those disks;
disk3s4 will be grown to cover the full space if possible.

'If "force" is not given, and the first partition is not resizable, you will be prompted if you want to erase.' Considering that DiskUtility does not allow re-size, sounds like it will not be allowed.
–
arinDec 28 '12 at 16:19

I think Disk Utility doesn’t allow resizing because Apple doesn’t want end users resizing partitions. The condition is not whether the “partition” is resizable, but rather the file system — it needs to be JHFS+. Fortunately that’s the default.
–
paulgravDec 28 '12 at 16:26

Might be, I am very interested in whether this would work. Hopefully the OP will keep us updated :)
–
arinDec 28 '12 at 16:29

Did it work? Does someone know how to reorder the partitions because with me *disk0s2 is my Macintosh - main partition *disk0s3 is my Recovery HD *disk0s4 is my 2nd partition that i want to merge with main partition
–
tdhulsterFeb 27 '13 at 23:45

The primary partition can only be resized when all the other partitions - if existing - is deleted.
Take a backup of the existing non-primary partition is highly suggested as all the data on those existing partitions will be lost.

summarily -
1. Take a back up of all the existing non-primary ( and primary too) partitions.
2. delete all the non-primary partition using Disk Utility tool.
3. resize the primary partition using Disk Utility tool.

You can't resize an existing partition in Disk Utility. Your only options are

Create a separate partition to make use of the unused space.

Copy all your data to a backup drive, then erase and repartition the disk, then move your data back (when reformatting, be sure to select the drive, not just the existing named partition, or you will end up with the same unused disk space).