Storage Administration: LVM, Filesystems, Mount Configuration, and Disk Management
Storage questions on this exam are practical: build an LVM stack, grow it without downtime, wire it into /etc/fstab correctly, and recover when a mount fails at boot.
LVM layers
pvcreate /dev/sdbโvgcreate vg_data /dev/sdbโlvcreate -n lv_app -L 20G vg_data; inspect withpvs,vgs,lvs,pvdisplay.lvextend -L +10G -r /dev/vg_data/lv_appresizes the LV and grows the filesystem in one step;-l +100%FREEconsumes remaining extents.- Metadata backups are in
/etc/lvm/backup;vgcfgrestorerecovers a damaged volume group. After enlarging a virtual disk, runpvresizebefore extending.
Filesystems
- XFS is the default on OL8/OL9: grow online with
xfs_growfs(or-r), and it cannot be shrunk. - ext4 grows and shrinks with
resize2fs; shrinking requires unmounting ande2fsck -ffirst. - Labels:
mkfs.xfs -L app /dev/vg_data/lv_app,blkidto read UUIDs,tune2fs -Lfor ext4.
Mount configuration
/etc/fstabentries preferUUID=; useful options aredefaults,nofail,_netdev. Test withmount -a, thensystemctl daemon-reloadso systemd regenerates its.mountunits.findmnt --verifyvalidates the table.- Partitioning:
partedfor GPT,fdiskfor MBR (2 TiB limit),partprobeto re-read,wipefs -ato clear stale signatures,sfdisk --dumpfor backups.
Worked example
A database LUN holding /u01 is 95% full. lvextend -L +20G -r /dev/vg_data/lv_u01 is correct because -r invokes fsadm, detects XFS, and calls xfs_growfs on the mounted filesystem. Confirm with df -h /u01 and lvs. If the filesystem were ext4 and space had to be removed, the order reverses: unmount, e2fsck -f, resize2fs, then lvreduce.
Traps
- Attempting to shrink XFS is impossible; plan layout before loading data.
- A typo in
/etc/fstabdrops the host to emergency mode; fix withmount -o remount,rw /sysrootand edit/sysroot/etc/fstab. - Device names like
/dev/sdbcan move; UUIDs do not. - LVM snapshots that fill up become invalid and are dropped.