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
Simple Extension Guide
- Resize VM hardisk
- lsblk to find the (sda) we need to increase
- 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.
- Now comes time to gather info
- vgdisplay (write down the VG Name)
- lvdisplay (write down the LV Name and Path you want to extend)
- pvresize /dev/(sda that we are interested in)
- vgdisplay (vgname from step 5) | grep "Free" --write down the free space in GB
- lvextend -L+19.5GB (lvpath from step 6)