The standard warning applies: Be very careful. This will wipe the entire disk that you are repartitioning. One small typo could result in the wrong disk being wiped!
Here's how to do it:
- Open Terminal, and if your account doesn't have administrator privileges, su to the administrator user.
- Type diskutil info /Volumes/partition_to_clone/ to find the size of the partition you want to clone. The output should include something like this:
Total Size: 74.2 Gi (79682387968 B) (155629664 512-byte blocks)
- Note the number of 512-byte blocks, and then add 262144 to that number. Why 262144? Because that amount is added to each partition, for "future use by Apple, and are populated as needed for some boot methods, such as AppleRAID booting on PowerPC systems," according to this email message.
- Create the new partition using the augmented size you just calculated, for example:
sudo diskutil partitionDisk partition_id 2 GPTFormat "Journaled HFS+" "Bootable Clone" 155891808S "Journaled HFS+" "Spare" 1Gpartition_id represents the disk that you are partitioning, for example, /dev/disk1. diskutil automatically extends the final partition to use the remaining space on the disk, so the given size (1G) doesn't actually mean anything here. The S suffix means that the size is being specified in 512-byte blocks.

