Skip to Content

Understanding Disk Partition in Linux – MBR vs GPT

A disk partition is a contiguous space of storage on a physical or logical disk that functions as if it were a physically separate disk.

Partitions are visible to the system firmware and the installed operating systems. Access to a partition is controlled by the system firmware before the system boots the operating system, and then by the operating system after it is started.

A partition table tells the operating system how the partitions and data on the drive are organized.

There are two main types of partition tables: MBR and GPT.

Understanding MBR Partition table

  • MBR stands for Master Boot Record and is a bit of reserved space at the beginning of the drive that contains information about how the partitions are organized.
  • The MBR also contains code to launch the operating system, and it’s sometimes called the Boot Loader. MBR also known as MS-DOS, is what we might call the original standard.

MBR is still the most widely used partition table, it comes with two major limitations.

  • It does not allow us to create more than four main partitions. Those partitions are called primary partitions.
  • Disk partitions may not exceed 2 TB.

 

Related: 5 Ways to Check disk size in Linux

Understanding GPT Partition table

  • GPT is an abbreviation of GUID Partition Table, and is a newer standard that’s slowly replacing MBR.
  • The GUID Partition Table (GPT) was introduced as part of the Unified Extensible Firmware Interface (UEFI) initiative. GPT provides a more flexible mechanism for partitioning disks than the older Master Boot Record (MBR) partitioning scheme that was common to PCs.
  • Unlike an MBR partition table, GPT stores the data about how all the partitions are organized and how to boot the OS throughout the drive. That way if one partition is erased or corrupted, it’s still possible to boot and recover some of the data. We can have multiple primary partitions, and the drive sizes can exceed 2 TB.

Difference between MBR and GPT

Compare with the MBR partitioning style, the GPT disk has more advantages. It allows each disk to have up to 128 primary partitions, and the maximum volume size can grow up to 18 petabytes, allowing using primary and backup partition tables for redundancy.

Also, it supports each GPT partition to have a unique identification ID (GUID). However, the maximum volume size supported by MBR disk is only 2 TB (terabytes) and each disk can only have at most 4 primary partitions (or 3 primary partitions + 1 extended partition, in this way unlimited logical partitions can be created on the extended partition).

Related: Check Linux Block Device with Examples

How to choose between GPT and MBR?

  • If we are installing on older hardware, especially on old laptops, consider choosing MBR because its BIOS might not support GPT
  • If we are partitioning a disk that is larger than 2 TiB, we need to use GPT.
  • It is recommended to always use GPT for UEFI boot, as some UEFI implementations do not support booting to the MBR while in UEFI mode.
  • If none of the above apply, choose freely between GPT and MBR. Since GPT is more modern, it is recommended in this case.

 

Check disk partition table in Linux command line

Parted command should work on all Linux distributions. Open a terminal and use the following command with sudo:

sudo parted -l

The above command is actually a CLI-based partitioning manager in Linux. With the option -l, it lists the disks on our system along with the details about those disks. It includes partitioning scheme information.

  • parted /dev/sdc print
  • Model: ORICO H/ W RAID0 (scsi)
  • Disk /dev/sdc: 6001GB
  • Sector size (logical/physical): 512B/4096B
  • Partition Table: gpt

In the above output, look for the line starting with Partition Table: the disk has GPT partitioning scheme.

For MBR, it would show msdos like below.

  • Model: ATA TOSHIBA MQ01ACF0 (scsi)
  • Disk /dev/sda: 320GB
  • Sector size (logical/physical): 512B/4096B
  • Partition Table: msdos

Related: