The MBR is stored in the the first 512 bytes of the disk. It consist of 3 parts:
|-----------------------446 bytes bootloader--------------------|------64 bytes partition table-------|-id-|
-
The first 446 bytes contain the boot loader.
-
The next 64 bytes contain the partition table (4 entries of 16 bytes each, one entry for each primary partition).
-
The last 2 bytes contain an identifier
# backup MBR dd if=/dev/sda of=/img/sda-mbr.img bs=512 count=1 #restore dd if=/img/sda-mbr.img of=/dev/sda bs=512 count=1 # backup partition table dd if=/dev/sda of=/img/sda-part.img seek=446 skip=446 bs=64 count=1 dd if=/img/sda-part.img of=/dev/sda/ seek=446 skip=446 bs=64 count=1