Chapter Ten

Storage and Disks

The stack below the filesystem: raw block devices, the volume and RAID layers that sit on top of them, swap, and at-rest encryption — the parts you provision once and have to get right.

5 topics

A filesystem is the layer you touch every day, but it sits on a stack you set up rarely and rebuild even less: a kernel block device, a partition table that carves it up, and optionally a volume manager or a RAID array between the disk and the filesystem. Get this layout wrong at install time and you pay for it later — a partition that cannot grow, an array that loses data on the second disk failure, a server that drops into an OOM kill with no warning.

This chapter works bottom-up. It starts with block devices and GPT partitioning, adds LVM for resizable and snapshottable volumes, covers software RAID with mdadm and exactly what redundancy it does and does not buy you, explains swap and the OOM killer that decides who dies under memory pressure, and finishes with LUKS for encrypting data at rest. The examples are Debian/Ubuntu, with Red Hat equivalents noted where the tooling diverges.

From raw disk to a mounted filesystem
Block device/dev/sda, /dev/nvme0n1
PartitionGPT layout
LVM / RAIDoptional layer
Filesystemext4 / XFS
Mountinto the tree

Topics in This Chapter