A partition table tells the system how a disk is divided. There are two formats: the old MBR (Master Boot Record) and the modern GPT (GUID Partition Table). New systems use GPT almost everywhere, but you’ll still meet MBR on older servers and some virtual machines.
MBR vs GPT
| MBR | GPT | |
|---|---|---|
| Maximum disk size | 2 TiB (with 512-byte sectors) | Practically unlimited (zettabytes) |
| Number of partitions | 4 primary (or 3 + extended with logical partitions) | 128 by default |
| Redundancy | Single copy at the start of the disk | Primary header at the start, backup at the end |
| Integrity checks | None | CRC32 checksums on headers and partition entries |
| Partition identifiers | 1-byte type codes | GUIDs for type and for each partition, plus names |
| Boot firmware | BIOS (legacy) | UEFI; BIOS too, with a small BIOS boot partition for GRUB |
Use GPT for any new disk, and always for disks larger than 2 TiB.
How GPT is laid out
- Protective MBR (sector 0) — a fake MBR so old tools see the disk as “in use”.
- Primary GPT header (sector 1) and partition entries.
- Partitions.
- Backup partition entries and backup header at the end of the disk.
If the primary header is damaged, tools can recover from the backup.
GPT and booting
- UEFI systems boot from an EFI System Partition (ESP) — a FAT32 partition (typically 100–550 MB) mounted at
/boot/efi. - BIOS systems can boot from GPT with GRUB if there’s a tiny (1 MB) BIOS boot partition where GRUB stores its core image.
Many virtual servers boot with BIOS; check with:
[ -d /sys/firmware/efi ] && echo UEFI || echo BIOS
Inspect a disk
lsblk -o NAME,SIZE,TYPE,FSTYPE,PARTTYPENAME,MOUNTPOINTS
fdisk -l /dev/vda # "Disklabel type: gpt" or "dos" (= MBR)
parted /dev/vda print
gdisk -l /dev/vda # from the gdisk package
Create a GPT table on a new disk
This erases the partition table of the target disk — double-check the device name:
parted /dev/vdb --script mklabel gpt
parted /dev/vdb --script mkpart data ext4 1MiB 100%
mkfs.ext4 /dev/vdb1
Or interactively with gdisk /dev/vdb (o new GPT, n new partition, w write).
Convert MBR to GPT
gdisk can convert an MBR disk to GPT without destroying data — it rewrites only the partition table. Still:
- Back up everything first.
- On a boot disk, you’ll need to make the system bootable from GPT afterwards: add a BIOS boot partition (BIOS) or an ESP (UEFI), then reinstall GRUB.
- Make sure
/etc/fstabuses UUIDs, not device names.
gdisk /dev/vdb # it detects MBR and offers to convert; review with 'p', then 'w'
For the boot disk of a production server, a fresh install with the new layout is often simpler and safer than converting in place.
Repair a damaged GPT
If the primary header is corrupt, gdisk can rebuild it from the backup (recovery menu r, then b). sgdisk --backup=table.bin /dev/vda saves a copy of the table you can restore later with --load-backup.
Summary
GPT replaces MBR with larger disk support, more partitions, redundancy and checksums. Use it for every new disk; convert old ones carefully with gdisk after a backup. For hands-on resizing, see partitioning with GParted.