1

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.

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.

  • this doesnt work - gparted sees my main hfs partition as "unknown" – redbeam_ Feb 3 '18 at 16:17
1

Following instructions from this helpful article, I wiped and rebuilt the partition table (GPT). Basic commands used:

sudo diskutil unmount /dev/disk3
sudo gpt show /dev/disk3 > ~/tmp/disk3-gpt
sudo gpt destroy /dev/disk3
sudo gpt create -f /dev/disk3    # -f for MBR compatibility
sudo gpt add -b ${start} -s ${size} -t ${type_guid} /dev/disk3
# repeat above command for each partition to be re-added

Afterwards, I used the Disk Utility application to resize the HFS+ volume. It worked!

OSX may remount partitions immediately after they are re-added; in this case, you will need to unmount them again before continuing to re-add more partitions.

If the command line is not your thing, well, then you probably didn't clone your drive with dd in the first place.

  • Worked for me. I rebuilt the GPT table and now I can resize the main hfs partition. You have to use the gpt destroy command instead of gpt delete though (ref). – redbeam_ Feb 3 '18 at 16:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .