First we save the GUID (Globally Unique Identifier) Partition Table (GPT), so that we can restore the same partition table on the target machine. We use the commandline version of gdisk for this, named sgdisk
sgdisk --backup=/srv/macos/parttable.gpt.sgdisk /dev/sda