[ SRE_ARENA ]
STORAGE & FILESYSTEMS

Storage & Filesystems: Where Data Goes to Live (or Die).

Visualization: 1. The LVM Stack (Logical Volume Manager)
DOWNLOADING CONCEPT: 1. THE LVM STACK (LOGICAL VOLUME MANAGER)...
  • ↳In the old days, you formatted a raw disk and mounted it.
  • ↳If it filled up, you had downtime to migrate data.
  • ↳LVM abstracts physical disks into a flexible pool of storage.
  • ■Raw Disk (`/dev/sda`): The actual block device hardware (SSD, NVMe, HDD).
  • ■PV (Physical Volume): This initializes the raw disk for LVM (pvcreate /dev/sda). It writes a small metadata header to the disk.
  • ■VG (Volume Group): A massive pool of storage created by combining multiple PVs (vgcreate data_vg /dev/sda /dev/sdb). Think of it as a virtual hard drive.
  • ■LV (Logical Volume): A virtual partition carved out of the VG (lvcreate -n db_lv -L 100G data_vg). You can instantly resize an LV on the fly!
  • ■FS (Filesystem): Formatted on top of the LV and mounted (mkfs.ext4 /dev/data_vg/db_lv and mount /dev/data_vg/db_lv /data).

↳If the database LV is full, you just slide a new physical disk into the server, run vgextend to add it to the pool, and lvextend to grow the partition—zero downtime!

▲ LIVE INCIDENTA developer complains they can't write a 1KB log file to /var/log. df -h shows the disk is only 40% full.
sre@arena:~/storage-filesystems
sre@arena:~$ df -i /var/log