LVM Storage Basics: A Simple Hands-On Lab for Linux Beginners
Professor Linux
Explore the essentials of LVM (Logical Volume Manager) with this hands-on lab designed for Linux enthusiasts. Enhance your skills as a Linux sysadmin by mastering LVM management tools. Please note that this course is not endorsed or sponsored by Red Hat.
Objectives:
Create Physical Devices:
Use fdisk -l to identify disk names. Create physical devices with the command: pvcreate /dev/xvdg /dev/xvdf Create a Volume Group:
Form a volume group on the previously created physical devices: vgcreate RHCSA /dev/xvdg /dev/xvdf Create a Logical Volume:
Generate a logical volume named "pinehead" with a size of 3GB in the "RHCSA" volume group: lvcreate -n pinehead -L 3G RHCSA Format the LV as XFS and Mount It Persistently at /mnt/lvol:
Format the logical volume as XFS: mkfs.xfs /dev/mapper/RHCSA-pinehead Create a mount point: mkdir /mnt/lvol Obtain the UUID using blkid. Edit /etc/fstab and add a new line with the UUID for persistent mounting: bash Copy code UUID="THE-UUID-YOU-COPIED" /mnt/lvol xfs defaults 0 0 Save and exit, then run: mount -a Grow the Mount Point by 200 MB:
Expand the logical volume by 200MB: lvextend -L+200M /dev/RHCSA/pinehead Automatically resize the filesystem with LVM tools using: lvextend -r /dev/RHCSA/pinehead or manually with: xfs_growfs /mnt/lvol ... https://www.youtube.com/watch?v=UwjMwTbzHDA
35715006 Bytes