UPWORK/ODESK guru: Tips and Tricks for clients

skype: upwork.link , email: info@upwork.link

How to copy a GPT partition scheme from one hard drive to another?

without comments

On a non-GPT partition table you can do

sfdisk -d /dev/sda | sfdisk /dev/sdb.

But sfdisk doesn’t support GPT partition tables.
Then you shall make:

Install gdisk from repositories or source.
Then use the sgdisk command (man page here) like so

sgdisk -R=/dev/sdb /dev/sda
sgdisk -G /dev/sdb

The first command copies the partition table of sda to sdb.
The second command randomizes the GUID on the disk and all the partitions.
This is only necessary if the disks are to be used in the same machine, otherwise it’s unnecessary.

If you tried and it didn’t work. The solution is:

sgdisk --backup=table /dev/sda
sgdisk --load-backup=table /dev/sdb
sgdisk -G /dev/sdb

Written by spectre

June 13th, 2013 at 12:34 pm

Posted in Tips and Tricks

Leave a Reply

*