This directory covers the management of physical and logical storage. In RHEL 9, speed and precision with LVM are critical for passing the EX200.
- Partitioning: Create and manage MBR and GPT partitions using
fdiskorgdisk. - LVM (Logical Volume Management): Create Physical Volumes (PV), Volume Groups (VG), and Logical Volumes (LV).
- LVM Resizing: Extend an existing LV and its filesystem without data loss.
- Swap Space: Create, enable, and persistently mount swap partitions or files.
- VDO & Stratis: Understand and configure advanced storage solutions (Note: Focus on LVM-based VDO in RHEL 9).
| Step | Command | Description |
|---|---|---|
| 1 | pvcreate /dev/sdb1 |
Initialize partition as a Physical Volume |
| 2 | vgcreate vg_data /dev/sdb1 |
Create a Volume Group named vg_data |
| 3 | lvcreate -n lv_docs -L 500M vg_data |
Create a 500MB Logical Volume |
| 4 | mkfs.xfs /dev/vg_data/lv_docs |
Format with XFS filesystem |
| 5 | mkdir /mnt/docs |
Create a mount point |
To extend an LV and resize the XFS filesystem simultaneously:
lvextend -r -L +200M /dev/vg_data/lv_docs
(The -r flag is your best friend—it resizes the filesystem for you!)
- Create partition/file.
mkswap /dev/sdb2swapon /dev/sdb2- Add to
/etc/fstab:/dev/sdb2 swap swap defaults 0 0
- The Growth Drill: Create a 200MB LV, mount it, add a file, then extend it to 500MB while it's mounted. Verify the file is still there.
- Swap on Demand: Add a new 1GB swap partition to your system and ensure it is active after a reboot.
- VG Extension: Add a second physical disk to your KVM VM, turn it into a PV, and add it to an existing Volume Group to increase the "free pool."
If you create a partition or LV but forget to add it to /etc/fstab, the system may boot, but you will lose points. Always test your mounts with mount -a before rebooting.