Gentoo Wiki


Master Boot Record. It is located in the first sector of the first hard disk or a floppy disk. It contains a small program that is read into memory and executed at boot (after the BIOS bootup). The program tries to find a bootable partition in the partition table (which is located in the end of the MBR sector). The boot sector of the partition is then loaded and executed. This normally is some boot loader but can also be an actual kernel of some specific OS. In Linux LILO or GRUB is usually installed in the MBR.

In linux the MBR can be directly accessed with dd.

To save the MBR:

# dd if=/dev/hda of=/path/mbr-backup bs=512 count=1

Erase the MBR:

# dd if=/dev/zero of=/dev/hda bs=446 count=1

Restore the MBR:

# dd if=/path/mbr-backup of=/dev/hda bs=512 count=1

WARNING...Making a typo on the restore command may mean too much is over-written or the wrong MBR is over-written. If this happens to you, try the recovery procedure in MBR and partition recovery.

Retrieved from ""

Last modified: Fri, 12 Oct 2007 11:24:00 +0000 Hits: 8,022