A master boot record (MBR) is a type of boot sector in the first block of partitioned computer mass storage devices like fixed disks or removable drives intended for use with IBM PC-compatible systems and beyond. The concept of MBRs was publicly introduced in 1983 with PC DOS 2.0.
The MBR holds the information on how the disc's sectors (A.K.A. "blocks") are divided into partitions, each partition notionally containing a file system. The MBR also contains executable code to function as a loader for the installed operating system—usually by passing control over to the loader's second stage, or in conjunction with each partition's volume boot record (VBR). This MBR code is usually referred to as a boot loader.
The organization of the partition table in the MBR limits the maximum addressable storage space of a partitioned disk to 2 TiB . Approaches to slightly raise this limit utilizing 32-bit arithmetic or 4096-byte sectors are not officially supported, as they fatally break compatibility with existing boot loaders, most MBR-compliant operating systems and associated system tools, and may cause serious data corruption when used outside of narrowly controlled system environments. Therefore, the MBR-based partitioning scheme has been superseded by the GUID Partition Table (GPT) scheme in almost all new computers. A GPT can coexist with an MBR in order to provide some limited form of backward compatibility for older systems.
MBRs are not present on non-partitioned media such as floppies, superfloppies or other storage devices configured to behave as such, nor are they necessarily present on drives used in non-PC platforms.
Overview Support for partitioned media, and thereby the master boot record (MBR), was introduced with IBM PC DOS 2.0 in March 1983 in order to support the 10 MB hard disk of the then-new IBM Personal Computer XT, still using the FAT12 file system. The original version of the MBR was written by David Litton of IBM in June 1982. The partition table supported up to four primary partitions. This did not change when FAT16 was introduced as a new file system with DOS 3.0. Support for an extended partition, a special primary partition type used as a container to hold other partitions, was added with DOS 3.2, and nested logical drives inside an extended partition came with DOS 3.30. Since MS-DOS, PC DOS, OS/2 and Windows were never enabled to boot off them, the MBR format and boot code remained almost unchanged in functionality (except some third-party implementations) throughout the eras of DOS and OS/2 up to 1996.
In 1996, support for logical block addressing (LBA) was introduced in Windows 95B and MS-DOS 7.10 (Not to be confused with IBM PC-DOS 7.1) in order to support disks larger than 8 GB. Disk timestamps were also introduced. This also reflected the idea that the MBR is meant to be operating system and file system independent. However, this design rule was partially compromised in more recent Microsoft implementations of the MBR, which enforce CHS access for FAT16B and FAT32 partition types /, whereas LBA is used for /.
Despite sometimes poor documentation of certain intrinsic details of the MBR format (which occasionally caused compatibility problems), it has been widely adopted as a de facto industry standard, due to the broad popularity of PC-compatible computers and its semi-static nature over decades. This was even to the extent of being supported by computer operating systems for other platforms. Sometimes this was in addition to other pre-existing or cross-platform standards for bootstrapping and partitioning.
MBR partition entries and the MBR boot code used in commercial operating systems, however, are limited to 32 bits. Therefore, the maximum disk size supported on disks using 512-byte sectors (whether real or emulated) by the MBR partitioning scheme (without 32-bit arithmetic) is limited to 2 TiB. Consequently, a different partitioning scheme must be used for larger disks, as they have become widely available since 2010. The MBR partitioning scheme is therefore in the process of being superseded by the GUID Partition Table (GPT). The official approach does little more than ensuring data integrity by employing a protective MBR. Specifically, it does not provide backward compatibility with operating systems that do not support the GPT scheme as well. Meanwhile, multiple forms of hybrid MBRs have been designed and implemented by third parties in order to maintain partitions located in the first physical 2 TiB of a disk in both partitioning schemes "in parallel" and/or to allow older operating systems to boot off GPT partitions as well. The present non-standard nature of these solutions causes various compatibility problems in certain scenarios.
The MBR consists of 512 or more bytes located in the first sector of the drive.
It may contain one or more of: A partition table describing the partitions of a storage device. In this context the boot sector may also be called a partition sector. Bootstrap code: Instructions to identify the configured bootable partition, then load and execute its volume boot record (VBR) as a chain loader. Optional 32-bit disk timestamp. Optional 32-bit disk signature.
Disk partitioning IBM PC DOS 2.0 introduced the FDISK utility to set up and maintain MBR partitions. When a storage device has been partitioned according to this scheme, its MBR contains a partition table describing the locations, sizes, and other attributes of linear regions referred to as partitions.
The partitions themselves may also contain data to describe more complex partitioning schemes, such as extended boot records (EBRs), BSD disklabels, or Logical Disk Manager metadata partitions.
The MBR is not located in a partition; it is located at a first sector of the device (physical offset 0), preceding the first partition. (The boot sector present on a non-partitioned device or within an individual partition is called a volume boot record instead.) In cases where the computer is running a DDO BIOS overlay or boot manager, the partition table may be moved to some other physical location on the device; e.g., Ontrack Disk Manager often placed a copy of the original MBR contents in the second sector, then hid itself from any subsequently booted OS or application, so the MBR copy was treated as if it were still residing in the first sector.
Sector layout By convention, there are exactly four primary partition table entries in the MBR partition table scheme, although some operating systems and system tools extended this to five (Advanced Active Partitions (AAP) with PTS-DOS 6.60 and DR-DOS 7.07), eight (AST and NEC MS-DOS 3.x as well as Storage Dimensions SpeedStor), or even sixteen entries (with Ontrack Disk Manager).
+ Structure of a classical generic MBR Address Description Size(bytes) 0x0000 (0) Bootstrap code area 446 0x01BE (446) Partition entry №1 Partition table(for primary partitions) 16 0x01CE (462) Partition entry №2 16 0x01DE (478) Partition entry №3 16 0x01EE (494) Partition entry №4 16 0x01FE (510) 0x55 Boot signature 2 0x01FF (511) 0xAA Total size: 446 + 4×16 + 2 512
+ Structure of a modern standard MBR Address Description Size(bytes) 0x0000 (0) Bootstrap code area (part 1) 218 0x00DA (218) 0x0000 Disk timestamp (optional; Windows 95B/98/98SE/ME (MS-DOS 7.1–8.0). Alternatively, can serve as OEM loader signature with NEWLDR) 2 0x00DC (220) 1 0x00DD (221) Seconds (0–59) 1 0x00DE (222) Minutes (0–59) 1 0x00DF (223) Hours (0–23) 1 0x00E0 (224) Bootstrap code area (part 2, code entry at 0x0000) 216 (or 222) 0x01B8 (440) 32-bit disk signature Disk signature (optional; UEFI, Linux, Windows NT family and other OSes) 4 0x01BC (444) 0x0000 (0x5A5A if copy-protected) 2 0x01BE (446) Partition entry №1 Partition table(for primary partitions) 16 0x01CE (462) Partition entry №2 16 0x01DE (478) Partition entry №3 16 0x01EE (494) Partition entry №4 16 0x01FE (510) 0x55 Boot signature 2 0x01FF (511) 0xAA Total size: 218 + 6 + 216 + 6 + 4×16 + 2 512
+ Structure of AAP MBR Address Description Size(bytes) 0x0000 (0) Bootstrap code area 428 0x01AC (428) 0x78 AAP signature (optional) 2 0x01AD (429) 0x56 0x01AE (430) AAP physical drive (0x80–0xFE; 0x00: not used; 0x01–0x7F, 0xFF: reserved) AAP record (optional) (AAP partition entry #0 with special semantics) 1 0x01AF (431) CHS (start) address of AAP partition/image file or VBR/EBR 3 0x01B2 (434) Reserved for AAP partition type (0x00 if not used) (optional) 1 0x01B3 (435) Reserved for CHS end address in AAP (optional; byte at offset 0x01B5 is also used for MBR checksum (PTS DE, BootWizard); 0x000000 if not used) 3 0x01B6 (438) Start LBA of AAP image file or VBR/EBR or relative sectors of AAP partition (copied to offset +01Chex in the loaded sector over the "hidden sectors" entry of a DOS 3.31 BPB (or emulation thereof) to also support EBR booting) 4 0x01BA (442) Reserved for sectors in AAP (optional; 0x00000000 if not used) 4 0x01BE (446) Partition entry №1 Partition table(for primary partitions) 16 0x01CE (462) Partition entry №2 16 0x01DE (478) Partition entry №3 16 0x01EE (494) Partition entry №4 16 0x01FE (510) 0x55 Boot signature 2 0x01FF (511) 0xAA Total size: 428 + 2 + 16 + 4×16 + 2 512
+ Structure of NEWLDR MBR Address Description Size(bytes) 0x0000 (0) JMPS (EBhex) / NEWLDR record size (often 0x0A/0x16/0x1C for code start at 0x000C/0x0018/0x001E) NEWLDR record (optional) 2 0x0002 (2) "NEWLDR" signature 6 0x0008 (8) LOADER physical drive and boot flag (0x80–0xFE, 0x00–0x7E, 0xFF, 0x7F) (if not used, this and following 3 bytes must be all 0) 1 0x0009 (9) CHS address of LOADER boot sector or image file (f.e. IBMBIO.LDR) (0x000000 if not used) 3 0x000C (12) Allowed DL minimum, else take from partition table (0x80: default; 0x00: always use DL; 0xFF: always use table entry) 1 0x000D (13) Reserved (default: 0x000000) 3 0x0010 (16) LBA of LOADER boot sector or image file (optional; 0x00000000 if not used) 4 0x0014 (20) Patch offset of VBR boot unit (default 0x0000 if not used, else 0024hex or 01FDhex) 2 0x0016 (22) Checksum (0x0000 if not used) 2 0x0018 (24) OEM loader signature ("MSWIN4" for REAL/32, see also offset +0DAhex, corresponds with OEM label at offset +003hex in VBRs (optional) 6 Varies Bootstrap code area (code entry at 0x0000) Varies 0x01AC (428) 0x78 AAP signature (optional) 2 0x01AD (429) 0x56 0x01AE (430) AAP partition entry №0 with special semantics AAP record (optional) 16 0x01BE (446) Partition entry №1 Partition table(for primary partitions) 16 0x01CE (462) Partition entry №2 16 0x01DE (478) Partition entry №3 16 0x01EE (494) Partition entry №4 16 0x01FE (510) 0x55 Boot signature 2 0x01FF (511) 0xAA Total size: 30 + 398 + 2 + 16 + 4×16 + 2 512
+ Structure of AST/NEC MS-DOS and SpeedStor MBR Address Description Size(bytes) 0x0000 (0) Bootstrap code area 380 0x017C (380) 0x5A AST/NEC signature (optional; not for SpeedStor) 2 0x017D (381) 0xA5 0x017E (382) Partition entry №8 AST/NEC expanded partition table(optional; also for SpeedStor) 16 0x018E (398) Partition entry №7 16 0x019E (414) Partition entry №6 16 0x01AE (430) Partition entry №5 16 0x01BE (446) Partition entry №4 Partition table(for primary partitions) 16 0x01CE (462) Partition entry №3 16 0x01DE (478) Partition entry №2 16 0x01EE (494) Partition entry №1 16 0x01FE (510) 0x55 Boot signature 2 0x01FF (511) 0xAA Total size: 380 + 2 + 4×16 + 4×16 + 2 512