Understanding GPT and MBR

Every disk needs a partition table — a data structure that tells the operating system how the disk is divided. There are two standards: MBR (the legacy standard from 1983) and GPT (the modern standard that supersedes MBR). Most Ubuntu servers installed since 2012 use GPT. Understanding the difference matters when you add new disks, troubleshoot boot failures, or restore a system.

MBR (Master Boot Record)

MBR layout (first 512 bytes of disk):
┌──────────────────────────────────────────────────────┐
│ Boot code (446 bytes) — runs at system startup        │
│ Partition table (64 bytes) — 4 entries × 16 bytes     │
│   Entry 1: Boot flag, start/end CHS, type, LBA info  │
│   Entry 2: ...                                        │
│   Entry 3: ...                                        │
│   Entry 4: Extended partition (optional)              │
│ Boot signature (2 bytes) — 0x55 0xAA                  │
└──────────────────────────────────────────────────────┘
Limitations:
  - Maximum 4 primary partitions (or 3 + 1 extended with logical partitions)
  - Maximum disk size: 2.2 TB
  - No redundancy: single point of failure for partition table

GPT (GUID Partition Table)

GPT layout:
┌──────────────────────────────────────────────────────┐
│ Protective MBR (block 0) — makes MBR tools see 1 part │
│ GPT Header (block 1) — disk GUID, CRC, backup pointer │
│ GPT Partition entries (blocks 2-33) — up to 128 parts │
│   Each: start LBA, end LBA, attributes, GUID, name   │
│ ... Data partitions ...                               │
│ GPT Partition entries backup (blocks -33 to -2)       │
│ GPT Header backup (last block)                        │
└──────────────────────────────────────────────────────┘
Advantages:
  - Up to 128 partitions (default)
  - Maximum disk size: 9.4 ZB (effectively unlimited)
  - Redundant headers: backup GPT at end of disk
  - Each partition has a GUID and human-readable name

Choosing between GPT and MBR

FactorUse GPTUse MBR
Disk sizeAny size (required for >2 TB)Only disks < 2 TB
UEFI bootRequired for UEFI bootRequired for legacy BIOS boot
Partition countUp to 1284 primary (or 3+extended)
New serversDefault choiceOnly if legacy BIOS required
VM guestsDefault choiceSome older hypervisors require MBR

Rule of thumb: Use GPT for all new installations and new disks. The only reason to use MBR is compatibility with very old hardware or software that does not support GPT.

Checking partition table type

# Check partition table type with fdisk
sudo fdisk -l /dev/sda | head -5

GPT disk output from fdisk -l

Disk /dev/sda: 500 GiB, 536870912000 bytes, 1048576000 sectors
Disk model: Samsung SSD 870
Units: sectors of 1 * 512 = 512 bytes
Disklabel type: gpt        ← GPT partition table
Disk identifier: 12345678-1234-1234-1234-123456789abc
# Check with parted
sudo parted /dev/sda print | head -5

# Check partition table type (quick one-liner)
sudo parted /dev/sda print 2>/dev/null | grep "Partition Table"

# Check all disks at once
for disk in /dev/sd?; do
    echo -n "$disk: "
    sudo parted "$disk" print 2>/dev/null | grep "Partition Table"
done

Converting MBR to GPT

⚠️ WARNING: Converting the OS boot disk from MBR to GPT is a complex operation that can render the system unbootable. It requires converting the bootloader (GRUB configuration changes) and may require adding an EFI System Partition. Only do this on a system you can afford to reinstall, with a full backup. For data-only disks (not the OS disk), conversion is simpler and safer.

# For DATA disks only (not the boot disk):
# Install gdisk
sudo apt install -y gdisk

# Convert MBR to GPT non-destructively (if no data is on the disk)
sudo gdisk /dev/sdb
# Inside gdisk: w → write GPT table

# Check the result
sudo parted /dev/sdb print | grep "Partition Table"

Conclusion

All new Ubuntu servers installed with UEFI firmware use GPT automatically. Always use GPT when adding new data disks to a server — in fdisk, use the g command to create a GPT partition table. GPT is required for disks larger than 2 TB and provides redundancy with its backup partition table at the end of the disk. Check the partition table type with sudo parted /dev/sda print | grep "Partition Table" when troubleshooting disk or boot issues.

FAQ

Is Understanding GPT and MBR important for Ubuntu administrators?+

Yes. It supports practical Ubuntu administration because it connects directly to server reliability, security, troubleshooting, or daily operations.

Should I practice this on a live server?+

Use a lab VM first. After you understand the command output and rollback path, apply the workflow carefully on real systems.

What should I do after reading this article?+

Run the practice commands, write down what each one shows, and continue to the next article in the Ubuntu roadmap.

Need help with Ubuntu administration?

Work directly with Muhammad Irfan Aslam for Ubuntu Server, Linux, cloud, Docker, DevOps, CI/CD, or infrastructure troubleshooting support.

Hire Me for Support