Skip to content

sfdisk, sgdisk

check with fdisk -l for the type of your disk and move on with sfdisk or sgdisk

sfdisk for MBR disks

dump / backup table:

sfdisk -d /dev/sda > sda.sfdisk

copy from sda to sdb:

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

sgdisk for GPT disks

dump / backup table:

sgdisk --backup=nvme0n1.sgdisk /dev/nvme0n1

copy from a to b:

sgdisk --replicate=/dev/nvme1n1 /dev/nvme0n1 # nvme1n1 is the DESTINATION

you can optionally change the uuids as well of the new disk:

sgdisk -G /dev/nvme1n1