In this lab, we’re going to go over the LVM management tool. These are skills that will serve you well in your career as a Linux sysadmin. Once complete, you’ll have a solid understanding of how to use these tools.
*This course is not approved or sponsored by Red Hat.*
Successfully complete this lab by achieving the following learning objectives:
- Create Physical Devices
Get the names of our disks:
Create the physical devices:
pvcreate /dev/xvdg /dev/xvdf
- Create a Volume Group
Create a volume group on the physical devices we created in the previous task:
vgcreate RHCSA /dev/xvdg /dev/xvdf
- Create a Logical Volume
Create the Logical Volume:
lvcreate -n pinehead -L 3G RHCSA
-ndenotes the name of the LV.
-Ldenotes the size of the LV.
RHCSAis the name of the volume group we’re creating this LV in.
- Format the LV as XFS and Mount It Persistently at `/mnt/lvol`
Format the disk as XFS:
Create a mount point:
Get the UUID:
Copy the UUID, and edit
Create a new line that looks like:
UUID="THE-UUID-YOU-COPIED" /mnt/lvol xfs defaults 0 0
Save and exit, and then run:
- Grow the Mount Point by 200 MB
To grow the LV, run:
lvextend -L+200M /dev/RHCSA/pinehead
To have the LVM tools automatically resize the filesystem, you could pass the
Another way to resize the filesystem is by running: