5 added link to related documentation
source | link

You can use sfdisksfdisk for this task.

Save:

sfdisk -d /dev/sda > part_table

Restore:

sfdisk /dev/sda < part_table

For GPT partition tables, this requires sfdisk from util-linux 2.26 or later. It was re-written from scratch on top of libfdisk.

This copies the UUIDs unchanged, rather than generating new ones. So the new disk is a clone of the original, not just another disk with the same layout. Note that Linux's /dev/disk/by-uuid/ looks at filesystem UUIDs, though, not UUIDs in the partition table. sfdisk will generate new UUIDs if you edit out the UUIDs from the dump (per-partition and the UUID for the partition table itself near the start of the file).

You can use sfdisk for this task.

Save:

sfdisk -d /dev/sda > part_table

Restore:

sfdisk /dev/sda < part_table

For GPT partition tables, this requires sfdisk from util-linux 2.26 or later. It was re-written from scratch on top of libfdisk.

This copies the UUIDs unchanged, rather than generating new ones. So the new disk is a clone of the original, not just another disk with the same layout. Note that Linux's /dev/disk/by-uuid/ looks at filesystem UUIDs, though, not UUIDs in the partition table. sfdisk will generate new UUIDs if you edit out the UUIDs from the dump (per-partition and the UUID for the partition table itself near the start of the file).

You can use sfdisk for this task.

Save:

sfdisk -d /dev/sda > part_table

Restore:

sfdisk /dev/sda < part_table

For GPT partition tables, this requires sfdisk from util-linux 2.26 or later. It was re-written from scratch on top of libfdisk.

This copies the UUIDs unchanged, rather than generating new ones. So the new disk is a clone of the original, not just another disk with the same layout. Note that Linux's /dev/disk/by-uuid/ looks at filesystem UUIDs, though, not UUIDs in the partition table. sfdisk will generate new UUIDs if you edit out the UUIDs from the dump (per-partition and the UUID for the partition table itself near the start of the file).

4 added 162 characters in body
source | link

You can use sfdisk for this task.

Save:

sfdisk -d /dev/sda > part_table

Restore:

sfdisk /dev/sda < part_table

For GPT partition tables, this requires sfdisk from util-linux 2.26 or later. It was re-written from scratch on top of libfdisk.

This copies the UUIDs unchanged, rather than generating new ones. So the new disk is a clone of the original, not just another disk with the same layout. Note that Linux's /dev/disk/by-uuid/ looks at filesystem UUIDs, though, not UUIDs in the partition table. sfdisk will generate new UUIDs if you edit out the UUIDs from the dump (per-partition and the UUID for the partition table itself near the start of the file).

You can use sfdisk for this task.

Save:

sfdisk -d /dev/sda > part_table

Restore:

sfdisk /dev/sda < part_table

For GPT partition tables, this requires sfdisk from util-linux 2.26 or later. It was re-written from scratch on top of libfdisk.

This copies the UUIDs unchanged, rather than generating new ones. So the new disk is a clone of the original, not just another disk with the same layout. Note that Linux's /dev/disk/by-uuid/ looks at filesystem UUIDs, though, not UUIDs in the partition table.

You can use sfdisk for this task.

Save:

sfdisk -d /dev/sda > part_table

Restore:

sfdisk /dev/sda < part_table

For GPT partition tables, this requires sfdisk from util-linux 2.26 or later. It was re-written from scratch on top of libfdisk.

This copies the UUIDs unchanged, rather than generating new ones. So the new disk is a clone of the original, not just another disk with the same layout. Note that Linux's /dev/disk/by-uuid/ looks at filesystem UUIDs, though, not UUIDs in the partition table. sfdisk will generate new UUIDs if you edit out the UUIDs from the dump (per-partition and the UUID for the partition table itself near the start of the file).

3 added 109 characters in body
source | link

You can use sfdisk for this task.

Save:

sfdisk -d /dev/sda > part_table

Restore:

sfdisk /dev/sda < part_table

For GPT partition tables, this requires sfdisk from util-linux 2.26 or later. It was re-written from scratch on top of libfdisk.

This copies the UUIDs unchanged, rather than generating new ones. So the new disk is a clone of the original, not just another disk with the same layout. Note that Linux's /dev/disk/by-uuid/ looks at filesystem UUIDs, though, not UUIDs in the partition table.

You can use sfdisk for this task.

Save:

sfdisk -d /dev/sda > part_table

Restore:

sfdisk /dev/sda < part_table

For GPT partition tables, this requires sfdisk from util-linux 2.26 or later. It was re-written from scratch on top of libfdisk.

This copies the UUIDs unchanged, rather than generating new ones. So the new disk is a clone of the original, not just another disk with the same layout.

You can use sfdisk for this task.

Save:

sfdisk -d /dev/sda > part_table

Restore:

sfdisk /dev/sda < part_table

For GPT partition tables, this requires sfdisk from util-linux 2.26 or later. It was re-written from scratch on top of libfdisk.

This copies the UUIDs unchanged, rather than generating new ones. So the new disk is a clone of the original, not just another disk with the same layout. Note that Linux's /dev/disk/by-uuid/ looks at filesystem UUIDs, though, not UUIDs in the partition table.

2 sfdisk does now support GPT
source | link
1
source | link