Skip to content
linux storage

Partition

partition gpt mbr storage disks filesystem
Plain English

A partition is a slice of a disk. One physical drive can be split into several partitions, and the computer treats each one almost like its own drive. A typical Linux install has a small partition for boot files and a large one for everything else. On Windows, the “C:” drive is a partition. Partitioning is how you decide what lives where before you format and use a disk.

Technical Definition

A partition is a contiguous range of blocks on a disk, recorded in a partition table at the start of the disk.

Partition table types:

  • GPT (GUID Partition Table): the UEFI standard. Supports disks far beyond 2 TiB and 128 partitions by default, and keeps a backup copy of the table at the end of the disk.
  • MBR (Master Boot Record): legacy. 2 TiB limit, four primary partitions (or three plus an extended partition).

Typical Ubuntu UEFI layout:

PartitionSizeFilesystemMount
EFI System Partitionabout 1 GBFAT32 (vfat)/boot/efi
Rootrest of diskext4/

Some layouts add a separate /boot, /home, or swap partition, or use LVM so space can be resized later.

Naming in Linux: SATA and USB disks are /dev/sda, /dev/sdb; partitions are /dev/sda1, /dev/sda2. NVMe disks are /dev/nvme0n1 with partitions /dev/nvme0n1p1. VirtIO disks are /dev/vda.

Partition vs filesystem: the partition is the space; the filesystem (ext4, XFS, NTFS) is the structure written inside it with mkfs. Each partition and filesystem also gets a UUID, which /etc/fstab uses because device names can change between boots.

Source: Arch Wiki: Partitioning

Viewing and creating partitions

# Disks, partitions, filesystems, and mount points
$ lsblk -f
NAME   FSTYPE LABEL UUID                                 MOUNTPOINTS
sda
├─sda1 vfat         1A2B-3C4D                            /boot/efi
└─sda2 ext4         3f1c9a7e-...                         /

# Partition table detail
$ sudo fdisk -l /dev/sda
Disklabel type: gpt

# On a NEW, EMPTY second disk only: GPT table, one partition, ext4
$ sudo parted /dev/sdb --script mklabel gpt mkpart data ext4 0% 100%
$ sudo mkfs.ext4 -L data /dev/sdb1
$ sudo blkid /dev/sdb1
In the Wild

Partitioning shows up at install time, when adding a new disk, and when a disk fills up. The habits that save you: always run lsblk before touching a disk, never partition the disk you booted from while it is mounted, and reference filesystems by UUID in /etc/fstab. In a VM, practice is free: add a second virtual disk in VirtualBox and partition that instead of your system disk. For servers, many admins skip classic partitions on data disks and hand the whole disk to LVM or ZFS.