Comparing GPT and MBR Partition Structures

Published on April 28, 2017

Comparing GPT and MBR Partition Structures

Original author: Melanie Gross
  • Transfer
Have you ever thought about how a computer boots up? Regardless of the hardware or operating system, all computers use either the traditional BIOS-MBR method or the more modern UEFI-GPT implemented in the latest versions of the OS when booting.

In this article, we compare the GPT and MBR partition structures; GPT stands for GUID Partition Table, and MBR stands for Master Boot Record. Let's start by disassembling the boot process itself.

The following chapters highlight the differences between the styles of the GPT and MBR sections, including instructions on how to convert between the two styles, and tips on which one to choose.

Understanding the boot process


When you press the power button on your PC, the process starts, which ultimately leads to the loading of the operating system into memory. The first command depends on what the partition structure is on your hard drive.

If there are two kinds of partition structures: MBR and GPT. The partition structure on the disk defines three things:

  1. Data structure on disk.
  2. The code that is used when booting if the partition is bootable.
  3. Where the section begins and ends.

MBR boot process


Back to the boot process. If your system uses the MBR partition structure, the first execution process will load the BIOS. The basic structure of the input / output (Basic Input / Output System) includes the loader firmware. The bootloader firmware contains low-level functions, such as keyboard input, access to a video display, disk I / O, and code for loading the bootloader's initial stage. Before the BIOS can determine the boot device, it performs a series of system configuration functions, starting with the following:

  • Power-on self test.
  • Video card detection and initialization.
  • Displays the BIOS startup screen.
  • Implementation of a quick memory check (RAM).
  • Plug and play device configuration.
  • Defining a boot device.

Once the BIOS has detected the boot device, it reads the first disk sector of this device into memory. The first sector of the disk is the 512 MB byte master boot record (MBR). Three objects fit in this size:

  • The first stage of the bootloader (446 bytes).
  • Disk Partition Table (16 bytes per partition × 4 partitions) - MBR supports only four partitions, more on this below.
  • Signature (2 bytes).

At this stage, the MBR scans the partition table and loads into the RAM the boot sector - Volume Boot Record (VBR).

VBR usually contains the initial program loader - Initial Program Loader (IPL), this code initiates the boot process. The initial program loader includes a second stage loader, which then loads the operating system. On systems of the Windows NT family, such as Windows XP, the bootloader first downloads another program called NT Loader (abbreviation NTLDR), which then loads the operating system.

For Linux kernel operating systems, the GRUB (Grand Unified Bootloader) bootloader is used. The boot process is similar to that described above, the only difference in the name of the boot loaders in the first and second stages.



In GRUB, the first stage of the bootloader is called GRUB Stage 1. It loads the second stage, known as GRUB Stage 2. The second stage of loading gets a list of operating systems on the hard drives and provides the user with a list for choosing the OS to boot.

GPT boot process


At the same boot stage, the following occurs in the GPT partition structure. The GPT uses UEFI , in which there is no MBR procedure like storing the first stage of the bootloader in the boot sector, followed by calling the second stage of the bootloader. UEFI, the Unified Extensible Firmware Interface, is a more advanced interface than the BIOS. He can analyze the file system and even upload files himself.



After turning on your computer, UEFI first performs the functions of the system configuration, as well as the BIOS. This is energy management, setting dates and other components of system management.

UEFI then reads the GPT partition table of the GUID. The GUID stands for Globally Unique Identifier. GPT is located in the first sectors of the disk, immediately after sector 0, where the main boot record for the Legacy BIOS is still stored.

The GPT defines the partition table on the disk on which the EFI boot loader recognizes the EFI system partition. The system partition contains bootloaders for all operating systems installed on other sections of the hard drive. The bootloader initializes the Windows boot manager, which then loads the operating system.

For Linux kernel operating systems, there is a version of GRUB with EFI support that downloads a file, such as grub.efi, or an EFI bootloader, which downloads its file, such as elilo.efi.

You may notice that both UEFI-GPT and BIOS-MBR transfer control to the bootloader, but they themselves do not directly load the operating system. However, UEFI does not require going through several stages of the bootloader, as in the BIOS. The boot process takes place at a very early stage, depending on your hardware configuration.

Differences between GPT and MBR Partition Structures


If you ever tried to install Windows 8 or 10 on a new computer, you most likely saw the question: what partition structure to use, MBR or GPT.

If you want to know more or if you plan to install a new operating system on a computer, then read on. We have already examined the differences in boot processes that you should keep in mind when splitting a disk or choosing a partition structure.

GPT is a newer and more advanced partition structure, and it has many advantages, which I will list below. MBR has been used for a long time, it is stable and has maximum compatibility. Although the GPT may supersede the MBR over time, as it offers more advanced features, in some cases only the MBR can be used.

Master boot record


MBR is a traditional structure for managing disk partitions. Since it is compatible with most systems, it is still widely used. The main boot record is located in the first sector of the hard drive or, more simply, at the very beginning. It contains a partition table - information about the organization of logical partitions on a hard disk.

The MBR also contains executable code that scans partitions for the active OS and initializes the OS boot procedure.

An MBR disk allows only four primary partitions. If you need more, you can designate one of the partitions as an extended partition, and on it you can create more partitions or logical drives.

The MBR uses 32 bits to write the section length expressed in sectors, so each section is limited to a maximum size of 2 TB.

Benefits
  • Compatible with most systems.

disadvantages
  • It allows only four sections, with the possibility of creating additional subsections on one of the main sections.
  • Limits the partition size to two terabytes.
  • Information about the partition is stored in only one place - in the master boot record. If it is damaged, then the entire disk becomes unreadable.

GUID Partition Table (GPT)


GPT is a newer standard for defining partition structure on a disk. Global unique identifiers (GUIDs) are used to determine the structure.

This is part of the UEFI standard, that is, a UEFI-based system can only be installed on a disk that uses GPT, for example, this is a requirement of the Windows 8 Secure Boot feature.

GPT allows the creation of an unlimited number of partitions, although some operating systems may limit their number to 128 partitions. Also in GPT there is practically no limit on partition size.

Benefits
  • Allows an unlimited number of sections. The limit is set by the operating system, for example, Windows allows no more than 128 partitions.
  • Does not limit the size of the partition. It depends on the operating system . The limit on the maximum partition size is greater than the size of any disks that exist today. For disks with sectors of 512 bytes, the maximum size is 9.4 ZB (one zettabyte is 1,073,741,824 terabytes)
  • The GPT stores a copy of the partition and boot data and can recover data if the main GPT header is damaged.
  • The GPT stores the checksum using the cyclic redundancy check (CRC) algorithm to verify the integrity of its data (used to verify the integrity of the GPT header data). In the event of damage, the GPT may notice a problem and try to recover the damaged data from another location on the disk.

disadvantages
  • May not be compatible with older systems.

GPT vs MBR


  • The GPT allows an unlimited number of primary partitions, while the MBR allows only four primary partitions, and the rest - additional.
  • GPT allows you to create partitions of any size, while the MBR has a limit of 2 TB.
  • GPT stores a copy of the partition data, allowing you to restore it in case of damage to the main GPT header; The MBR stores only one copy of the partition data in the first sector of the hard disk, which can lead to the loss of all information in the event of corruption of the partition information.
  • GPT stores checksum values ​​to verify that the data is not corrupted, and can perform the necessary recovery from other areas of the disk in case of corruption; MBR has no way to find out about data corruption, you can only find out if the computer refuses to boot or the partition disappears.

OS Compatibility


The first sector (sector 0) on the GPT disk contains a protective MBR record, in which it is written that the disk has one partition that extends to the entire medium. If you use old tools that read only MBR discs, you will see one large section the size of the entire disc. A protective record was made so that the old tool did not mistakenly recognize the disk as empty and did not overwrite the GPT data with a new master boot record.

MBR protects GPT data from being overwritten.

Apple MacBooks use GPT by default, so it’s not possible to install Mac OS X on an MBR system. Even though Mac OS X can run on an MBR drive, installation on it is not possible. I tried to do this, but to no avail.

Most Linux kernel operating systems are GPT compatible. When installing Linux OS, GRUB 2 will be installed as the bootloader.

For Windows operating systems, loading from GPT is possible only on computers with UEFI running under 64-bit versions of Windows Vista, 7, 8, 10 and corresponding server versions. If you bought a laptop with a 64-bit version of Windows 8, then with a high probability there is GPT.

Windows 7 and earlier systems are usually installed on MBR disks, but you can still convert partitions to GPT, as described below.

All versions of Windows Vista, 7, 8, 10 can read and use data from GPT partitions - but they cannot be loaded from such disks without UEFI.

So GPT or MBR?


You can feel comfortable with both MBR and GPT. But given the advantages of GPT, mentioned earlier, and the fact that modern computers are gradually moving to this technology, you may prefer GPT. If the goal is to support old hardware or if you need to use a traditional BIOS, then you are stuck on MBR.

Check Hard Disk Partition Type


On each Windows hard drive, you can check the type of partitions using Disk Management. To start "Disk Management" do the following:

Press the combination of "hot keys" Windows + R, a window for launching programs will open.

Type diskmgmt.mscand press Enter.

Windows will scan the hard drives and soon show them. To check the type of partitions of any hard disk, right-click on the disk plate at the bottom of the interface. You need to click on "Disk 0", "Disk 1" and so on, and not on partitions.



In the context menu that appears, select "Properties". A window opens with the properties of the selected drive.

Go to the “Volumes” tab and look at the “Section Style” value.



If you prefer the command line, you can choose another option. Its advantages are that it is slightly faster, since it immediately displays disks and partition styles.
  1. Press the Windows key, type cmd.exewhile holding Ctrl and Shift, press Enter.
  2. Confirm the UAC privilege escalation message on the system.
  3. Type diskpartand press Enter.
  4. Type list diskand press Enter again.



All drives are listed. The Gpt column shows the partition style for each drive. If you see an asterisk in the column, then this is GPT, if it is not, it is MBR.

Convert between MBR and GPT during Windows installation


There are two typical error messages that can occur when you install Windows on your hard drive:

  • Error No. 1: “Windows cannot be installed on this drive. The selected drive does not have a GPT partition style. ”
  • Error No. 2: “Windows cannot be installed on this drive. The selected drive has a GPT partition style. "

When one of these two errors appears, you may not be able to select the partition to install. But this does not mean that something is wrong with the computer.

As you already know, MBR and GPT are two completely different partition structures of a hard disk. MBR is a traditional partition structure, and GPT is a newer one.

Error No. 1 occurs when you try to install Windows on a computer with UEFI, and the hard disk partition is not configured for UEFI mode or compatibility with Legacy BIOS. Microsoft TechNet offers two solutions to the problem.

  1. Restart your computer in Legacy BIOS compatibility mode. This option will save the current section style.
  2. Reformat the disk to UEFI using the GPT partition style. This option allows you to use the UEFI firmware features. Reformatting can be done by yourself by following the instructions below. Always back up data before formatting.

Of course, there are third-party utilities for converting disks to GPT with saving data, but it is still safer to make a backup in case the utility can not complete the conversion.

Instructions for converting a hard disk from MBR to GPT




Using Windows Setup

  1. Turn off the computer and insert the Windows boot drive (USB or DVD).
  2. Boot from it in UEFI mode.
  3. Select “Custom” in the installation type.
  4. A screen appears with the message “Where do you want to install Windows?” Select all partitions on the disk and click “Delete”.
  5. After successful removal, the disk will be a single area of ​​unallocated space.
  6. Select unallocated space and click Next. Windows will detect that the computer is loaded in UEFI mode and automatically reformat the disk using the GPT partition style. The installation process will begin immediately after that.

Manual conversion

  1. Turn off the computer and insert the Windows boot drive (USB or DVD).
  2. Boot from it in UEFI mode.
  3. From a Windows installation, press Shift + F10 to open the console. After each next command, press Enter.
  4. Run the diskpart tool with the command diskpart.
  5. To select a drive to convert, type list disk.
  6. Specify the disk number for conversion: select disk #.
  7. Clean the drive: clean.
  8. Conversion to GPT is done by the team convert gpt.
  9. Type exitto exit diskpart.
  10. Close the console and return to the Windows installation.
  11. When choosing the type of installation, select "Other". The disk will be a single area of ​​unallocated space.
  12. Select unallocated space and click Next. Windows will start the installation.

GPT to MBR Hard Disk Conversion Instructions


Sometimes it may be necessary to convert a disk to an MBR partition structure. For example, if during the installation of Windows you receive the following error message:

“Windows cannot be installed on this drive. The selected drive has the GPT partition style. »

Downloading from GPT is supported only in 64-bit versions of Windows Vista, 7, 8, 10 and the corresponding server versions on UEFI systems. This error message means that your computer does not support UEFI, and therefore you can only use the BIOS, which works with the MBR partition structure.

Microsoft TechNet offers two solutions to the problem.

  1. Restart your computer in BIOS compatibility mode. This option will save the current section style.
  2. Reformat the disk using the MBR partition style. Always back up data before formatting. Although there are third-party utilities for converting disks to GPT with saving data, it is still safer to make a backup in case the utility cannot complete the conversion.

If you have chosen the second option, then follow the step-by-step instructions:

Using Windows Setup

  1. Turn off the computer and insert the Windows boot drive (USB or DVD).
  2. Boot from it in UEFI mode.
  3. Select “Custom” in the installation type.
  4. A screen appears with the message “Where do you want to install Windows?” Select all partitions on the disk and click “Delete”.
  5. After successful removal, the disk will be a single area of ​​unallocated space.
  6. Select unallocated space and click Next. Windows will detect that the computer is loaded in BIOS mode and will automatically reformat the disk using the MBR partition style. The installation process will begin immediately after that.

Manual conversion

  1. Turn off the computer and insert the Windows boot drive (USB or DVD).
  2. Boot from it in BIOS mode.
  3. From a Windows installation, press Shift + F10 to open the console. After each next command, press Enter.
  4. Run the diskpart tool with the command diskpart.
  5. To select a drive to convert, type list disk.
  6. Specify the disk number for conversion: select disk #.
  7. Clean the drive: clean.
  8. Conversion to GPT is done by the team convert mbr.
  9. Type exitto exit diskpart.
  10. Close the console and return to the Windows installation.
  11. When choosing the type of installation, select "Other". The disk will be a single area of ​​unallocated space.
  12. Select unallocated space and click Next. Windows will start the installation.


Training videos


What are disk partitions?



Differences between BIOS and UEFI



Partition Tables MBR and GPT



Sources


The following sources provide additional information on MBR or GPT partition styles: