RHCSA 6.4: Extending logical volumes
Growing a mounted XFS volume, growing a volume and its file system in two steps, and adding a disk to a full volume group.
Before you start
The lab adds two spare disks, /dev/loop40 (2 GiB) and /dev/loop41
(1 GiB, empty). They come back at every boot, before file systems are
mounted. On /dev/loop40 it creates volume group vg_lab with two
logical volumes, both mounted at every boot (lines in /etc/fstab):
lv_data, 500 MiB, XFS, at/data;lv_logs, 300 MiB, ext4, at/logs.
Each holds a file keep.txt that must survive.
Tasks
- Grow
lv_dataand its file system by 200 MiB without unmounting it. - Grow
lv_logsby 100 MiB without-r, and see whatdf -h /logssays. Then grow the file system to match. - Grow
lv_datato fill all ofvg_lab's free space. Then grow it by another 200 MiB by adding/dev/loop41(or a partition on it) tovg_lab.
Hints
lvextend -r -L +200M;lvs,df -h.lvextend -L +100M, thenresize2fs(ext4) orxfs_growfs(XFS).lvextend -l +100%FREE;vgsshowsVFree.pvcreate(or a partition withfdiskorparted),vgextend;pvs.