Facebook Twitter Instagram
    TecAdmin
    • Home
    • Ubuntu 20.04
      • Upgrade Ubuntu
      • Install Java
      • Install Node.js
      • Install Docker
      • Install LAMP Stack
    • Tutorials
      • AWS
      • Shell Scripting
      • Docker
      • Git
      • MongoDB
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    Home»Filesystem»How To Copy a GPT Partition Table to Another Disk using sgdisk

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

    RahulBy RahulMay 12, 20142 Mins Read

    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
    
    filesystem GPT MBR partition-table
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp
    Previous ArticleHow to Use If, else and elif statements in Shell Scripting
    Next Article Working with CASE Switches in Bash Shell Scripting

    Related Posts

    What is RAID Storage Technology

    Updated:March 26, 20173 Mins Read

    How to Mount and Unmount Filesystem in Linux

    Updated:March 1, 20172 Mins Read

    How to Add Swap on CentOS & RHEL 8/7/6

    Updated:July 6, 20202 Mins Read

    How To Format USB Drive in Linux Command Line

    Updated:August 7, 20212 Mins Read

    How to Increase Max Open File Limit in Linux System

    2 Mins Read

    How to Mount Remote File System over SSH in Linux

    Updated:July 10, 20213 Mins Read

    2 Comments

    1. Mstar on July 23, 2018 5:26 am

      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.

      Reply
    2. abhinav diwedi on May 29, 2014 3:48 pm

      Hi,
      how to uninstall windows OS from command prompt?

      Reply

    Leave A Reply Cancel Reply

    Recent Posts
    • How to Enable / disable Firewall in Windows
    • How to Install JAVA on Ubuntu 22.04
    • Switching Display Manager in Ubuntu – GDM, LightDM & SDDM
    • Changing the Login Screen Background in Ubuntu 22.04 & 20.04
    • How To Install PHP (8.1, 7.4 or 5.6) on Ubuntu 22.04
    Facebook Twitter Instagram Pinterest
    © 2022 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.