EMZETT.
Login

MBR (Master Boot Record)

In short: The MBR is the first sector (512 bytes) of a disk. It contains a small startup program and the partition table with up to four entries. It belongs to the old BIOS method.

In more detail: The BIOS loads this sector into memory and runs it. The program inside looks for the partition marked “active” and loads its boot sector, from which the actual bootloader starts.

In Depth

Structure of the 512 bytes:

BytesContent
0 – 445Boot code (446 bytes)
446 – 509Partition table: 4 entries of 16 bytes
510 – 511Signature 0x55AA (mark of a valid MBR)
  • Limits: Addresses are 32 bits wide, hence at most about 2 TiB per disk. Only four primary partitions. Whoever needs more creates an extended partition with logical drives.
  • No protection: The boot code is not signed. Boot viruses and bootkits nest there. That is why Secure Boot and GPT are safer.
  • Repair: In Windows bootrec /fixmbr, in Linux grub-install or ms-sys. Back up the table with dd if=/dev/sda of=mbr.bak bs=512 count=1.
  • Successor: GPT. Converting MBR to GPT is possible with mbr2gpt.
  • Do not confuse: The volume boot record (VBR) is the boot sector of a single partition, the MBR that of the whole disk.

See also: GPT (GUID Partition Table), Legacy boot (BIOS mode), Partitions