Resizing HFS+ volume after cloning

I cloned a disk containing an HFS+ volume to a larger disk using the command line dd utility. Now I want to grow the HFS+ volume to fill the new disk. There's an EFI partition before the HFS+ volume in the partition table but nothing after it.

When I attempt to resize the HFS+ volume in Disk Utility, it acts like everything works, but completes in about 4 seconds without making any changes to the partition table. Trying from the command line using sudo diskutil resizeVolume /dev/disk3s2 0 gives 0 does not appear to be a valid disk size. If I use a size of 2T instead, I get the error Error: -5341: MediaKit reports partition (map) too small.

How can I resize this partition? I'd prefer not to have to copy the data to the new drive all over again.


Solution 1:

This is really terrifying that the only answer suggest to overwrite your gpt table.

The correct and safest solution, with explanation, is from this comment.

  1. download GParted-Live CD from http://www.gparted.org/download.php
  2. boot from this CD
  3. accept the suggestion to enable the full disk
  4. reboot from mac OSX
  5. try again – now you can resize it!

Explanation:

The only problem is the disk header which exists twice: at the beginning and at the end of of the disk. Somehow Mac OSX shows the real disk size, but is not capable to change the GPT size header and to relocate the second “header” to the real disk end.