Cheat Sheet for LVM Management

Recently encountered some tricky issues with extending LVMs on CentOS7. Partly because of a not so good understanding of how it works. So I've compiled a list of resources to better understand how it works.

Dan's LVM Cheat Sheet - Quick Command Reference for LVM

VMware KB Extending a logical volume in a virtual machine running Red Hat or Cent OS (1006371)

pvresize doesn't seem to resize after increasing the size of the underlying block device

How can I tell pvresize to expand a physical volume to include all available space?

5.3.7. Removing Physical Volumes from a Volume Group

6.6. Removing Lost Physical Volumes from a Volume Group

Reload fstab (/etc/fstab)

Simple Extension Guide

  1. Resize VM hardisk
  2. lsblk to find the (sda) we need to increase
  3. Use parted to extend it.
    • parted
    • print (grab the partition number of the sda interested in)
    • resizepart (number from previous step)
    • enter in then end of the new partition from the amount of free space.
  4. Now comes time to gather info
  5. vgdisplay (write down the VG Name)
  6. lvdisplay (write down the LV Name and Path you want to extend)
  7. pvresize /dev/(sda that we are interested in)
  8. vgdisplay (vgname from step 5) | grep "Free" --write down the free space in GB
  9. lvextend -L+19.5GB (lvpath from step 6)