Skip to content

How To Copy a GPT Partition Table to Another Disk using sgdisk

Copy a GPT Partition Table. GPT (GUID Partition Table) is a standard for the layout of the partition table on a physical hard disk, using GUID

Category
Linux
Covers
Disk Management
On this page

What is GPT Partition ?

GPT (GUID Partition Table) is a standard for the layout of the partition table on a physical hard disk, using globally unique identifiers (GUID). GPT is a part of the EFI standard that defines the layout of the partition table. GPT is useful for creating filesystem on disk larger than 2TB. For smaller size of disks generally we use MBR but it does not support disk over 2TB.

sgdisk is a command-line GUID partition table (GPT) manipulator for Unix like systems.

In this article we are using sgdisk command to Clone/Copy a GPT Partition Table to Another Disk. You may got confuse with sgdisk parameters sequences, so be careful while using this command.

Command Syntax

To clone GPT partition table command syntax are as following.

# sgdisk -R <New_Disk> <Existing_Disk>

The command syntax is bit confusing in sequence New disk and existing disk, so take care on it. Basically New Disk comes first.

Clone Partition Table on New Disk

Lets make a clone of Partition table to a new disk. For example our Existing disk is /dev/sda and need to clone partition table to new disk /dev/sdb.

# sgdisk -R /dev/sdb /dev/sda

Also set a new GUID on new drive after cloning the partition table

# sgdisk -G /dev/sdb

Rahul

Rahul Kumar is the founder and chief editor of TecAdmin.net. A Red Hat Certified Engineer (RHCE), he has worked in IT since 2009, with hands-on experience in Linux system administration, DevOps, web hosting, cloud platforms and automation. He started TecAdmin in 2013 to share practical, step-by-step guides, and leads its editorial work with one aim: making technical learning clear and useful for sysadmins, developers and beginners alike.

2 Comments

  1. Dear Mr.Rahul, I have an issue in cloning my 2TB HDD, containing GPT (Windows) EFI, BIOS-boot partition and ext4 partitions, the system is dual boot, but when I clone and boot through the second (cloned) drive it give a grub prompt, does not show menu for selecting os i.e. windows or linux. on typing exit on(Grub>) prompt I am able to boot windows and is working fine, what may the issue, why grub loader is not getting cloned.
    Note: it says error cloning patition /sda7 to /sdb7, same way /sda9 to /sdb9. Please giveme a solution for this.

Leave a Reply

Your email address will not be published. Required fields are marked *


Back to top