The MBR is a 512 byte segment on the very first sector of your hard drive composed of three parts:
1) the boot code which is 446 bytes long,
2) the partiton table which is 64 bytes long, and
3) the boot code signature which is 2 bytes long.
To backup: dd if=/dev/sda of=/tmp/mbr.img_backup bs=512 count=1
To restore: dd if=/tmp/mbr.img of=/dev/sda bs=512 count=1