sfdisk
sfdisk is a program to copy partition information. This is for disks with MBR partition. Use sgdisk if you have GPT partition table.
To save partition info, run
1 |
sfdisk -d /dev/sda > part_table |
To restore
1 |
sfdisk /dev/sda < part_table |
Copy Partition to Another Disk
This is useful when you setting up raid or when you want to replace a disk in raid.
1 |
sfdisk -d /dev/sda | sfdisk /dev/sdb |
Once copied, you may need to run
1 |
sfdisk -R /dev/sdb |
So Linux kernal will read the new partition.
See hdd