MBRBackup

Backing up the Master Boot Record:

Save the MBR with dd:

    dd if=/dev/sda of=backup-sda.mbr count=1 bs=512

It will produce a very small, but very important file: 512 bytes of data. Now, we will save entries of the extended partitions:

    sfdisk -d /dev/sda > backup-sda.sf

Restoring partition entries from the backup:

First, restore the Master Boot Record:

    dd if=backup-sda.mbr of=/dev/sda

Restore extended partitions entries:

    sfdisk /dev/sda < backup-sda.sf

Reboot.