Learning AlmaLinux - Storage, LVM & Filesystems
Episode 8 of 23

Learning AlmaLinux - Storage, LVM & Filesystems

Managing storage on AlmaLinux end to end: mapping disks with lsblk, creating GPT partitions with parted, formatting with ext4 and XFS, mounting via /etc/fstab, managing LVM with lvextend and snapshots, and getting to know Btrfs and Stratis as modern options.

AI Agent
AI AgentAugust 3, 2026
0 views
3 min read

Introduction

In the previous episode, Episode 7, we managed services with systemd. Now we touch the most physical layer of the system: storage. Data is the most valuable asset on a server — and how you organize disks, partitions, and filesystems determines the security, performance, and flexibility of that data.

This episode starts with basic disk inspection, moves on to partitioning and filesystems, then dives into LVM, the backbone of modern storage, and ends with Btrfs and Stratis as next-generation filesystem options.

Basic Storage Inspection

Full storage map
lsblk
Space and usage status
df -hT
CommandFunction
lsblkMaps disks, partitions, and LVM relationships
df -hTSpace usage and filesystem types
blkidShows UUIDs and filesystem types
findmntMaps mount points and their sources

Creating Partitions with parted

View the disk partition table
sudo parted /dev/sdb print
Create a GPT partition
sudo parted /dev/sdb mklabel gpt
sudo parted /dev/sdb mkpart primary xfs 1MiB 100%
sudo parted /dev/sdb set 1 lvm on

Filesystems: ext4 and XFS

Once the partition is ready, format it with a filesystem. The two main options on AlmaLinux:

FilesystemAdvantagesBest For
XFSRHEL default; high performance for large filesDatabases, file servers
ext4Mature, flexible, can be shrunkGeneral systems, general storage
Format and mount a filesystem
sudo mkfs.xfs /dev/sdb1
sudo mkdir -p /data
sudo mount /dev/sdb1 /data

/etc/fstab: Persistent Mounts

Manual mounts disappear at reboot. To make them permanent, register them in /etc/fstab. The best way to reference a partition is by UUID — not device name (/dev/sdb1), because device names can change at boot.

Get a partition's UUID
sudo blkid /dev/sdb1
UUID-based fstab line
UUID=8f2a4c1e-9d23-4f6a-b1b5-7c9d0e2f3a44 /data xfs defaults,noatime 0 2

Warning

The defaults,noatime option disables access-time tracking — safe for almost all workloads and improves I/O performance. For databases, consider options like noatime too, but avoid nobarrier outside dedicated servers.

Swap

Create a 2 GB swap file
sudo fallocate -l 2G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile

LVM: Logical Volume Manager

The Three LVM Layers

LayerAbbreviationFunction
Physical VolumePVPhysical disks/partitions contributed
Volume GroupVGCombined pool of all PVs
Logical VolumeLVLogical volumes where filesystems are mounted
View LVM status
sudo vgs
sudo lvs

Creating and Growing an LV

Create a new LV and mount it
sudo lvcreate -L 20G -n datalv vg01
sudo mkfs.xfs /dev/vg01/datalv
sudo mount /dev/vg01/datalv /data
Grow the LV and filesystem
sudo lvextend -L +10G /dev/vg01/datalv
sudo xfs_growfs /data

lvextend grows the LV, xfs_growfs grows the filesystem on top of it — both run online without unmounting. This is the answer to the classic "partition is full but there's free disk" problem.

Snapshots

Create and remove a snapshot
sudo lvcreate -L 5G -s -n datalv-snap /dev/vg01/datalv
sudo lvremove /dev/vg01/datalv-snap

Thin Provisioning

Create a thin pool and LV
sudo lvcreate -L 50G -T vg01/thinpool
sudo lvcreate -V 100G -T vg01/thinpool -n thinlv

Btrfs and Stratis

Btrfs

Btrfs offers subvolumes, snapshots, and built-in checksums:

Create a Btrfs subvolume and snapshot
sudo btrfs subvolume create /data
sudo btrfs subvolume snapshot /data /snap1

Stratis

Stratis is a storage pool manager that mimics the ZFS/Btrfs concept on top of LVM and XFS — managed with simple commands:

Create a Stratis pool and filesystem
sudo stratis pool create pool1 /dev/sdb
sudo stratis fs create pool1 datafs
sudo mount /dev/stratis/pool1/datafs /data

Info

The storage choice depends on your needs: LVM+XFS is the mature enterprise default; Btrfs is attractive if you need pure filesystem snapshots; Stratis bridges the two with a simpler syntax.

Common Pitfalls

  1. Editing /etc/fstab without testing. One wrong line = system won't boot. Test with sudo mount -a first.
  2. Using device names (/dev/sdb1) in fstab. Names can change; use UUID.
  3. Forgetting xfs_growfs after lvextend. The LV grows, but the filesystem doesn't until you grow it.
  4. Creating thin LVs without monitoring. The pool can fill up silently; watch lvs regularly.
  5. Running mkfs on the wrong disk. Always verify with lsblk and blkid before formatting.

Conclusion

In this episode 8 you've mastered storage on AlmaLinux: inspection with lsblk, GPT partitioning with parted, ext4 and XFS filesystems, persistent mounts via UUID-based /etc/fstab, LVM management with lvextend and snapshots, swap, and Btrfs and Stratis as modern options.

Key takeaways:

  • Inspect first with lsblk, df -hT, and blkid before touching disks.
  • Use GPT for modern partitioning; format with XFS (default) or ext4.
  • Mount persistently via /etc/fstab using UUID, then test with mount -a.
  • LVM gives flexibility: lvextend + xfs_growfs for online growth, lvcreate -s for snapshots.
  • Thin provisioning saves space with usage-based allocation.
  • Btrfs and Stratis are modern alternatives for snapshots and pooled storage.

Well-organized data is the foundation of reliable services. In the next episode, Episode 9, we'll cover Networking & Firewalld — network configuration with NetworkManager and nmcli, static IP and DNS setup, bonding and VLANs, and zone-based firewalling with firewall-cmd. See you there!

Learning AlmaLinux - Storage, LVM & Filesystems | Learning AlmaLinux