LinuxXIII · Disks and Block DevicesPartitioning
Partitions, GPT, and MBR
What you'll learn
- Distinguish MBR and GPT partition tables
- Use fdisk, gdisk, and parted to inspect and create partitions
- Recognize the partition layout of a typical Linux host
- Plan a partition scheme for a new disk
Prerequisites
Verified against Ubuntu 24.04 LTS · Debian 12 (Bookworm) · RHEL 9.x · Rocky Linux 9.x · AlmaLinux 9.x · Linux kernel 6.1 LTS / 6.6 LTS · systemd 255+ · OpenSSH 8.7p1 (RHEL 9) / 9.6p1 (Ubuntu 24.04) · nftables 1.0.x · chrony 4.x · Pacemaker 2.1.x · Corosync 3.1.x · 2026-08-09
The partition table is the first structure on a disk. It tells the firmware and the kernel where each partition starts and ends. A Linux host cannot boot without a valid partition table on the boot disk.
MBR vs GPT
Two partition table formats are in production today. They are not compatible.
| MBR | GPT | |
|---|---|---|
| Max disk size | 2 TiB | 8 ZiB |
| Max partitions | 4 primary (or 3 + extended) | 128 |
| Backup header | No | Yes (end of disk) |
| CRC | No | Yes |
| Modern host | No (legacy) | Yes (default) |
$ fdisk -l /dev/sdaDisk /dev/sda: 100 GiB, 107374182400 bytes, 209715200 sectors
Units: sectors of 1 * 512 = 512 bytes
Disklabel type: gpt
Device Start End Sectors Size Type
/dev/sda1 2048 2099199 2097152 1G EFI System
/dev/sda2 2099200 209715166 207615967 99G Linux filesystemInspecting partitions
$ gdisk -l /dev/sdaGPT fdisk (gdisk) version 1.0.9
Partition table scan:
MBR: protective
BSD: not present
APM: not present
GPT: present
Found valid GPT with protective MBR; using GPT.
Disk /dev/sda: 209715200 sectors, 100.0 GiB
Number Start (sector) End (sector) Size Code Name
1 2048 2099199 1024.0 MiB EF00 EFI System
2 2099200 209715166 99.0 GiB 8300 Linux filesystemCreating a partition scheme
For a new disk, the standard production layout is:
- Create a GPT partition table with parted or gdisk
- Create partition 1 as the EFI System Partition (at least 512 MB, FAT32)
- Create partition 2 as a Linux filesystem (ext4 or xfs, rest of the disk)
- Or create partition 2 as an LVM physical volume for flexible storage
- Write the partition table and verify with fdisk -l
- Create the filesystem with mkfs.ext4 or mkfs.xfs
- Mount with a UUID in /etc/fstab; verify with mount -a
Partition types and codes
$ gdisk -l /dev/sda 2>/dev/null | grep -E '^\\s+[0-9]+'1 2048 2099199 1024.0 MiB EF00 EFI System
2 2099200 209715166 99.0 GiB 8300 Linux filesystemKnowledge check
Knowledge check · 3 questions
Q1. What is the maximum disk size for MBR partition tables?
Q2. GPT stores a backup header at the end of the disk for recovery if the primary header is corrupted.
Q3. Which of the following are correct for a production Linux host with a single boot disk? Select all that apply.
Passing score: 75%. Answers are checked in this browser.