MBR is stand for Master Boot Record, which is the first 512 Bytes of the hard disk. As everybody knows MBR is used to store the bootloader, partition table and so on. This was introduced by the IBM for their hardwares.
If we consider the structure of the MBR;
0 - 445 Bytes - mainly used to store the Boot Loader
446 - 509 Bytes - (64 Bytes) used to store the partition table
510 - 512 Bytes - Store the ending identifier "AA55" magic number
Boot Loader
Boot Loader is the area to use to initialize the booting process. Windows uses their own proprietary boot loader (eg; NTLDR), Linux system uses GRUB at this moment earlier used LILO and
so on.
GRUB (GRand Unified Bootloader) is a universal boot loader which can be used to boot any operating system, however NTLDR support only Windows
How does GRUB store all theses info
GRUB divides the boot loader into 2 parts; GRUB stage 1 (stored in the MBR) and GRUB stage 2 (as example stored in Linux /boot partition)
That is why GRUB can give a nice GUI with customized background images so on.
Partition Table
In MBR 64 Bytes are allocated to store the partition table. User is restricted to create only 4 primary partitions, each given 16 Bytes to store a primary partition. This is the reason only we can create a maximum 4 booting partition.
However, now u can create unlimited primary partition for any kind of operating systems using GPT (GUID Partition Table).
In computer hardware, GUID Partition Table (GPT) is a standard for the layout of the partition table on a physical hard disk. Although it forms a part of the Extensible Firmware Interface (EFI) standard (Intel's proposed replacement for the PC BIOS), it is also used on some BIOS systems because of the limitations of MBR partition tables, which restrict a disk partition's size to a maximum of 2.19 TB (2.19 × 1012 bytes) or 2 TiB?512 bytes (2,199,023,255,040 bytes or 4,294,967,295 (232?1) sectors × 512 (29) bytes per sector).GPT allows for a maximum disk and partition size of 9.4 ZB (9.4 × 1021 bytes) or 8 ZiB?512 bytes (9,444,732,965,739,290,426,880 bytes or 18,446,744,073,709,551,615 (264?1) sectors × 512 (29) bytes per sector).
As of 2010, most current OSs support GPT, although some (including Mac OS X and Windows) only support booting to GPT partitions on systems with EFI firmware.
-Wikipedia
Sometimes when u r booting a computer, as an example a Windows machine u can see an error message saying "NTLDR is missing!" and Linux systems u r taken to the GRUB prompt, this is because MBR is crashed.
What you can do to troubleshoot,
If it is a Windows machine u can fix the MBR, using a windows boot cd repair mode or in Linux u can install the GRUB again. NOTE: This will not gurantee to restore ur all partitions
Best way is back up your MBR, this is what a rescue disk does.
In Linux u can do it using a single line command
Code: Select all
# dd if=/dev/hdX of=/tmp/mbr.bin bs=512 count=1