Marcus Müller a.k.a. "Tethpub ZNeK"
crack-admin/coderâ„¢

03.11.2013

Easiest way to properly clone a drive (including all partitions) on OSX:

# dd if=/dev/disk7 of=/dev/disk6 bs=128m

Afterwards, adjust partition sizes with diskutil or Disk Utility. You might get the following error:

MediaKit reports partition (map) too small

In this case, you need to manually rebuild the GPT label of the disk:

# gpt show /dev/disk6 start size index contents 0 1 PMBR 1 1 Pri GPT header 2 32 Pri GPT table 34 6 40 409600 1 GPT part - C12A7328-F81F-11D2-BA4B-00A0C93EC93B 409640 486717952 2 GPT part - 48465300-0000-11AA-AA11-00306543ECAC 487127592 1269536 3 GPT part - 426F6F74-0000-11AA-AA11-00306543ECAC 488397128 976752007 1465149135 32 Sec GPT table 1465149167 1 Sec GPT header # diskutil unmount /dev/disk6s2 Volume Macintosh HD on disk6s2 unmounted # gpt destroy /dev/disk6 # gpt create -f /dev/disk6 # gpt add -b 40 -s 409600 -t C12A7328-F81F-11D2-BA4B-00A0C93EC93B /dev/disk6 /dev/disk6s1 added # gpt add -b 409640 -s 486717952 -t 48465300-0000-11AA-AA11-00306543ECAC /dev/disk6 /dev/disk6s2 added # gpt add -b 487127592 -s 1269536 /dev/disk6 gpt add: unable to open device '/dev/disk6': Resource busy # diskutil unmount /dev/disk6s2 Volume Macintosh HD on disk6s2 unmounted # gpt add -b 487127592 -s 1269536 -t 426F6F74-0000-11AA-AA11-00306543ECAC /dev/disk6 /dev/disk6s3 added

Now resizing with diskutil or Disk Utility won't fail any longer.