Disks and filesystems
Map the storage stack
Separate physical or virtual devices, partitions, volume management, filesystems, and mount points.
8 minute lesson
Server storage is a stack. A filesystem is not the same thing as the disk or logical volume underneath it.
When a disk fills up or fails, you fix the problem at one specific layer. If you can’t name the layers, you end up guessing.
The layers
From bottom to top:
- A block device: a physical disk, cloud volume, or virtual disk. Cloud volumes and virtual disks still appear as block devices inside Linux, with names like
/dev/sdaor/dev/nvme0n1. - An optional partition, a slice of that device.
- An optional volume management layer such as LVM, which pools devices and hands out flexible volumes.
- A filesystem such as ext4 or XFS, which turns raw blocks into files and directories.
- A mount point, the directory where that filesystem becomes visible.
Capacity is owned near the bottom. Files are owned at the top. You grow a disk at the block layer, but you free space at the filesystem layer.
See the whole stack
Use lsblk -f to see devices, partitions, filesystem types, labels, UUIDs, and mount points:
lsblk -f
NAME FSTYPE LABEL UUID MOUNTPOINTS
sda
├─sda1 vfat 70D2-1F02 /boot/efi
├─sda2 ext4 1c24164b-92e0-43d9-a5cb-9b1d2f3a8a11 /
└─sda3 LVM2_member pXlZ2f-Qm3t-0dKe-7hgB-Vc2a-N9uY-4rTq
└─vg0-data ext4 9a7f43c2-6c1d-4c2e-8f3a-2b64d0e51c77 /srv/data
sdb ext4 4e0c2ab8-11f9-4b62-9d34-8a2f6c0d91be /mnt/backups
The indentation is the stack itself. sda3 is a partition, it belongs to LVM, and the logical volume vg0-data carries the ext4 filesystem mounted at /srv/data.
Trace one path
To answer “which device holds this directory?”, ask findmnt:
findmnt /srv/data
TARGET SOURCE FSTYPE OPTIONS
/srv/data /dev/mapper/vg0-data ext4 rw,relatime
Here’s a classic mistake this catches. A big data volume exists, but it was never mounted, so /srv/data is just an empty directory on the root filesystem. The application writes there happily until the small root disk fills. findmnt would have shown the source as /dev/sda2, not the data volume.
Draw the stack for one server path from /srv/data down to its block device. Mark which layer owns capacity and which layer owns files.
Lesson completed