Backing up and Restoring Partition Tables
# Backup
sudo dd if=/dev/sda of=mbrbackup bs=512 count=1
# Restore
sudo dd if=mbrbackup of=/dev/sda bs=512 count=1
For GPT systems, we can use:
sudo sgdisk --backup=/tmp/sda_backup /dev/sda
Other tools that can be used:
fdisk
sfdisk
parted
gdisk
We can see what partitions:
cat /proc/partitions