How to resize Macintosh HD?
Solution 1:
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.
- In Disk Utility, create a new partition from the unused space.
- Open terminal.app, and from there you’ll run
diskutil mergePartitions
First you need to find out which partitions you’ll want to merge:
disktuil list
And hopefully you’ll see something like this:
/dev/disk0
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *500.1 GB disk0
1: EFI 209.7 MB disk0s1
2: Apple_HFS Macintosh HD 499.2 GB disk0s2
3: Apple_HFS Untitled 50.0 MB disk0s3
4: Apple_Boot Recovery HD 650.0 MB disk0s4
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.
If you need help with the mergePartitions
command:
Usage: diskutil mergePartitions [force] format name DiskIdentifier|DeviceNode DiskIdentifier|DeviceNode
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.
Solution 2:
This is typically the result of the Macintosh HD being a core storage partition and not a standard partition that sits directly in the partition table.
If you have turned on FileVault - this will convert your Mac to use Core Storage. You can also type the command in terminal to see whether my guess is correct: diskutil cs list
If you don't have Core Storage set up and have this inability to resize a volume, then something is amiss with the volume structure, as you should see a window like this:
If this doesn't do the trick comment or edit in what diskutil list
shows on the problematic Mac and there could be an easy command line solution to resizing things as well.
Solution 3:
OK Everyone! I've finally got around to fixing my Mac! For future reference, here is how I did it!
Firstly, I redownloaded the Mountain Lion installer from the App Store (as it is a digital download now) by holding Option and clicking 'Purchases' to make it appear (after reading a forum online).
After doing this, I created a new blank partition on my spare drive ready to create my own bootable Mac OS Mountain Lion installer.
Next, I downloaded a free app called 'Lion DiskMaker 2' (http://liondiskmaker.com) which took my installer and create a bootable drive out of it using my blank partition.
After that I created a Time Machine backup.
Then I booted into my new Mountain Lion installer and completely reformatted my Macintosh HD back into the 1 partition format.
Then I installed Mountain Lion onto that using my Time Machine backup.
And here I am back with the 1 partition and now using the entire drive! Lengthy process but got there in the end!
So if anyone else has got this problem, this is how to fix it! :)
Thanks for all of your help anyway!