0

I'm building out a VM image in VMWare/CentOS that will be copied and brought up a multiple boxes. When I initially set it up, I made the disk size too small, but did not realize it until all the configuration was done. I expanded the disk in VMWare, and it shows up in the VM fine.

I realize I can create a new partition with the space and add that to the Volume group. My issue with that is I want to keep this as clean as possible and would rather not have to carry around that extra partition for the next 5 years.

Can I resize the existing /dev/sda2 "Linux LVM" partition that the volume group is already using, then "vgextend" the volume group to use the expanded underlying partition. Something like "resize2fs" for volume groups?

John P
  • 1,679
  • 6
  • 38
  • 59

1 Answers1

1

Yes, you can absolutely resize the existing partition. Just make sure that the new/resized partition starts from the same location. After that (and rebooting, so that Linux recognizes the new size of the in-use partition) run pvresize on the PV and after that vgs or vgdisplay should show more space.

ptman
  • 28,394
  • 2
  • 30
  • 45