Quick Command – backup/restore partition table

Technical, Technology

Method 1

Backup:
sfdisk -d /dev/sda > sda_table
Restore:
sfdisk /dev/sda < sda_table

Method 2

Backup:
dd if=/dev/sda of=sda.mbr bs=512 count=1
Restore:
dd if=sda.mbr of=/dev/sda bs=512 count=1

Saving a human readable partition table

fdisk -l > partitions.lst

Advertisements