RHCSA study materials
RHCSA study resources

RHCSA: Configure local storage

RHCSA · Work through your exam, one topic at a time.

All guide sections

Configure local storage

Disks and partitions

Know lsblk, blkid, df -h, fdisk -l, parted, and partprobe. MBR allows four primary partitions and stops at 2 TB; GPT has neither limit. Partition type codes matter on MBR for LVM (8e) and swap (82). After partitioning, notify the kernel with partprobe or udevadm settle before creating a filesystem.

LVM

The workflow is always the same: pvcreate /dev/sdb1, then vgcreate vgdata /dev/sdb1, then lvcreate -L 2G -n lvapp vgdata, then mkfs.xfs /dev/vgdata/lvapp. Inspect with pvs, vgs, lvs. Grow a logical volume with lvextend -L +1G /dev/vgdata/lvapp and then resize the filesystem, or use lvextend -r to do both in one step. Shrinking is possible only for ext4; XFS cannot shrink.

Swap and persistence

mkswap /dev/sdc1, swapon /dev/sdc1, and an /etc/fstab entry whose mount point is none or swap and whose type is swap. Verify with swapon --show and free -h.

Traps: a malformed /etc/fstab line drops the system into emergency mode at boot, so always test with mount -a first and prefer UUID= over /dev/sdX, since device names shift. Use nofail for non-essential mounts. Never run mkfs on a mounted filesystem.

Rule of thumb: resize2fs is for ext4, xfs_growfs is for XFS, and lvextend -r chooses correctly for you.

Worked example: lvextend -r -L +2G /dev/vgdata/lvapp