Disk, partition, volume and file system

Four words describe four layers, and technicians use them precisely because the tools do:

  • The physical disk is the device: an SSD, a hard drive, a USB stick. See Storage.
  • A partition is a contiguous region of a disk, recorded in the disk's partition table, that the operating system treats as a separate unit. One disk can hold several partitions: one for Windows, one for recovery tools, one for data.
  • The file system is the structure written inside a partition that turns it into files and folders.
  • A volume is a storage area with a file system that the operating system can use and presents as one unit, with a drive letter or a mount point. Usually one partition holds one volume, but a volume can also span several disks, as with Storage Spaces, dynamic disks or Linux LVM.

So preparing a new disk always takes the same steps, whatever the operating system: create a partition table, create a partition, format it with a file system, and make it reachable with a drive letter or mount point.

Partition tables: MBR and GPT

The partition table records where each partition starts and ends. There are two schemes (GUID stands for Globally Unique Identifier), explained from the firmware side on BIOS, UEFI and Boot:

MBR (Master Boot Record) GPT (GUID Partition Table)
Partitions 4 primary, or 3 primary plus 1 extended partition holding logical drives 128 in Windows
Largest disk 2 TiB (with 512-byte sectors) 8 ZiB: no practical limit
Firmware to boot from it BIOS (legacy boot); UEFI can boot MBR removable media UEFI
Protection One copy in the first sector Backup copy at the end of the disk, checksums, and a protective MBR so old tools see the disk as in use
Use today Old PCs, some small removable media Every current system; required to boot Windows 11

Windows 11 requires UEFI with Secure Boot capability, and Windows only boots from GPT in UEFI mode, so every Windows 11 system disk is GPT. A 4 TB data disk initialized as MBR shows about 2 TiB (about 2.2 TB) of usable space and the rest as unallocated; the fix is to convert it to GPT, which in Disk Management requires deleting its partitions first. (For the system disk, Microsoft's mbr2gpt tool converts without deleting partitions; make a backup first.)

System partitions

Windows Setup on a UEFI system creates more partitions than just C:. Seeing them in Disk Management is normal; deleting them is not.

Layout of a GPT disk with Windows 11, from start to end: the protective MBR in the first sector, the primary GPT header and partition entries, the EFI System Partition formatted FAT32, the Microsoft Reserved partition of 16 MB, the Windows partition C: formatted NTFS, the recovery partition with WinRE, and the backup GPT at the end of the disk. GPT disk with Windows 11 (UEFI), default layout MBR prot. GPT header EFI FAT32 MSR 16 MB Windows (C:) NTFS, rest of the disk Recovery WinRE Backup GPT LBA 0 end of disk No drive letter: EFI System Partition, MSR and Recovery. Sizes not to scale.
A Windows 11 system disk: three small hidden partitions around the Windows volume, with the partition table stored twice.
  • EFI System Partition (ESP): a small FAT32 partition (typically 100 to 260 MB) with the boot loaders the UEFI firmware starts, such as Windows Boot Manager. Disk Management labels it "EFI System Partition".
  • Microsoft Reserved Partition (MSR): 16 MB, without a file system, kept free for Windows' own partition management. Disk Management does not even show it.
  • Windows partition: C:, NTFS (New Technology File System), the rest of the disk.
  • Recovery partition: several hundred MB with the Windows Recovery Environment (WinRE), used when Windows cannot start. See OS Troubleshooting.

Computer manufacturers sometimes add their own recovery partition with a factory image. On an MBR (BIOS) system the layout is simpler: a small "System Reserved" partition marked active, holding the boot files, followed by C:.

Formatting: quick and full

Formatting is writing a new, empty file system onto a partition or volume, which makes the old files unreachable through the operating system. Windows offers two kinds:

  • A quick format only writes the file system's structures: a new boot sector, an empty file table (on NTFS the Master File Table) and an empty root folder. It takes seconds. The old data stays on the disk until it is overwritten, so recovery tools can often still find it.
  • A full format does the same, and then scans the whole volume for bad sectors and, since Windows Vista, writes zeros to every sector. On a large hard drive that takes hours. Afterward, the old data cannot be recovered with ordinary tools.

On an SSD, a quick format also tells the drive (through TRIM) that all blocks are free, and there is no reason for a full format. Neither format is a reliable way to sanitize an SSD before it leaves the organization: the drive's controller keeps spare blocks that no format reaches. Use the manufacturer's secure erase or sanitize function, or disks that were encrypted from the start; data destruction is covered in the Security topic.

Drive letters and mount points

A drive letter is the letter followed by a colon (C:, D:) that Windows assigns to a volume or drive so that users and programs can reach it; there are at most 26. Why does Windows start at C:? MS-DOS reserved A: and B: for floppy disk drives, so the first hard disk became C:, and that convention never changed. Windows still normally lives on C:; further volumes, optical drives and USB sticks get the next free letters, and mapped network drives are often given letters from the end of the alphabet (Z:, Y:).

A mount point is a folder through which the contents of another volume are reached, so the volume becomes part of an existing folder tree instead of getting its own drive letter. In Windows, any empty folder on an NTFS volume can serve as a mount point: mount a new 2 TB disk at C:\Archive and everything saved there lands on the new disk. It avoids the 26-letter limit and keeps paths stable. Linux and macOS have no drive letters at all: every volume is mounted somewhere in the single tree that starts at /.

Windows Disk Management

Disk Management (diskmgmt.msc) is the Windows console for viewing and changing disks, partitions and volumes: initializing disks, creating, formatting, extending, shrinking and deleting volumes, and assigning drive letters. Open it by right-clicking Start (or Win+X) and choosing Disk Management; it is also part of Computer Management. The common tasks:

  • Initialize: a brand-new disk shows as "Unknown, Not Initialized". Initializing writes a partition table; Disk Management asks MBR or GPT (choose GPT).
  • New Simple Volume: right-click unallocated space. The wizard asks the size, a drive letter or empty NTFS folder (mount point), the file system, allocation unit size, a volume label and whether to do a quick format.
  • Extend Volume: grow an NTFS volume into unallocated space directly after it, without losing data.
  • Shrink Volume: free space at the end of a volume. It can only shrink up to files that cannot be moved, such as the page file or hibernation file, so it often offers less than the free space.
  • Change Drive Letter and Paths: assign, change or remove a drive letter, or add a mount point.

The status line of each volume tells you its role, for example "Healthy (Boot, Page File, Crash Dump, Basic Data Partition)" for C: and "Healthy (EFI System Partition)" for the ESP.

diskpart

diskpart is the command-line equivalent, available in Windows and in the recovery environment and Windows Setup (press Shift+F10 during Setup for a command prompt). It must run as administrator. You start it, then type commands at its own DISKPART> prompt:

diskpart
list disk
  Disk ###  Status         Size     Free     Dyn  Gpt
  --------  -------------  -------  -------  ---  ---
  Disk 0    Online          476 GB      0 B        *
  Disk 1    Online           58 GB      0 B

Disk 0 is the 476 GB system disk (GPT), disk 1 a 58 GB USB stick. To wipe the stick and make one NTFS volume on it:

select disk 1
detail disk
clean
convert gpt
create partition primary
format fs=ntfs quick label=Transfer
assign letter=T
exit
  • select disk 1 makes disk 1 the target of every following command; detail disk shows its model and volumes so you can confirm it is the right one.
  • clean removes the partition table and all partition and volume information from the selected disk. Every volume on it is gone at once. (clean all also writes zeros to every sector, which takes hours.)
  • convert gpt sets the partition style; create partition primary uses all free space; format … quick writes an NTFS file system; assign letter=T gives it a drive letter.

Basic and dynamic disks

A basic disk holds ordinary partitions, and is what Windows uses by default. A dynamic disk replaces partitions with volumes managed by Windows itself, which allowed spanned, striped and mirrored volumes across disks. Microsoft now documents dynamic disks as deprecated and recommends basic disks, or Storage Spaces when volumes must span disks. You mainly meet dynamic disks on older servers; a disk moved from another PC may show up as "Foreign" and need Import Foreign Disks.

Storage Spaces

Storage Spaces groups several physical disks into a storage pool and creates virtual disks ("spaces") from it, with a choice of resiliency: simple (no redundancy, like RAID 0), two-way or three-way mirror (like RAID 1), or parity (like RAID 5). Disks of different sizes can be combined and new ones added later. It is in Settings under System › Storage › Advanced storage settings (and in Control Panel). The redundancy ideas behind it are those of RAID; like RAID, it is no substitute for a backup.

Disks on Linux

Linux names disks as files under /dev: SATA, SAS and USB disks are /dev/sda, /dev/sdb with partitions /dev/sdb1; NVMe drives are /dev/nvme0n1 with partitions /dev/nvme0n1p1. Preparing a new, empty data disk /dev/sdb:

lsblk                                        # which disks and partitions exist
sudo parted /dev/sdb mklabel gpt             # new, empty GPT partition table
sudo parted -a optimal /dev/sdb mkpart data ext4 0% 100%
sudo mkfs.ext4 -L data /dev/sdb1             # format the partition as ext4
sudo mkdir -p /srv/data
sudo mount /dev/sdb1 /srv/data               # mount it into the tree
sudo blkid /dev/sdb1                         # show its UUID

fdisk (interactive, sudo fdisk -l lists all disks) and parted both create partitions; mkfs.ext4 or mkfs.xfs format them. Like diskpart, parted … mklabel and mkfs destroy what is on the target without asking twice, so check the device name with lsblk first.

A mount command lasts until the next reboot. To mount a volume at every start, add a line to /etc/fstab (file system table), using the UUID (universally unique identifier) because names like sdb can change when disks are added:

UUID=3f6c2a0e-8d4b-4c1e-9a57-2b1f0c9e7d42  /srv/data  ext4  defaults,nofail  0  2

The fields are: what to mount, where, the file system type, options (nofail lets the system boot even if the disk is missing), a legacy dump flag, and the order for file system checks at boot. Test with sudo mount -a before rebooting: an error in /etc/fstab can drop the system into emergency mode at the next start.

Servers often add a layer in between: the Logical Volume Manager (LVM). Disks or partitions become physical volumes, which are pooled into a volume group, from which logical volumes are cut. A logical volume can be enlarged online, or span a newly added disk, which is why many server installers use LVM by default.

Disks on macOS

On a Mac, Disk Utility (Applications › Utilities) does what Disk Management does. By default it lists only volumes; choose View › Show All Devices to see the physical disks. Erase is Apple's word for formatting: you pick a format (APFS, Mac OS Extended, ExFAT or MS-DOS (FAT), which is FAT32) and a scheme (GUID Partition Map or Master Boot Record).

APFS adds a layer: a disk partition holds an APFS container, and the container holds several volumes that share its free space, so there is no need to decide volume sizes in advance. A current Mac's internal disk shows a read-only, cryptographically sealed system volume (Macintosh HD), a data volume with users' files (Macintosh HD - Data) and small helper volumes. In Terminal, diskutil shows the same (illustrative, shortened):

diskutil list
/dev/disk3 (synthesized):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      APFS Container Scheme -                      +494.4 GB   disk3
                                 Physical Store disk0s2
   1:                APFS Volume Macintosh HD            11.2 GB    disk3s1
   2:                APFS Volume Preboot                 6.1 GB     disk3s2
   3:                APFS Volume Recovery                1.0 GB     disk3s3
   4:                APFS Volume Data                    212.6 GB   disk3s5
   5:                APFS Volume VM                      20.5 KB    disk3s6

All five volumes live in one 494.4 GB container and draw from the same free space. External volumes are mounted under /Volumes.