Something very basic but took me several hours to workout. I had a VM that I wanted to increase a VG as I wanted to create a new LV. I increased the partition in the host server so the PV of the VG had the extra space, but then I couldnt see the increase inside the VM:
[root@HOST]# lvs LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert vm_data vg_os -wi-ao---- 300.00g [root@VM]# pvs PV VG Fmt Attr PSize PFree /dev/vdb vg_data lvm2 a-- <200.00g 1020.00m
"fdisk" was telling me the disk was already 300G...
[root@VM ~]# fdisk /dev/vdb Welcome to fdisk (util-linux 2.32.1). Changes will remain in memory only, until you decide to write them. Be careful before using the write command. The old LVM2_member signature will be removed by a write command. Device does not contain a recognized partition table. Created a new DOS disklabel with disk identifier 0xd46fa2fc. Command (m for help): p Disk /dev/vdb: 300 GiB, 322122547200 bytes, 629145600 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0xd46fa2fc
I did a pvscan... and nothing. What I was missing? just "pvresize".... and then I can see my extra 100G in the PV and in the VG. So I can create the new LV I wanted...
[root@VM ~]# pvresize /dev/vdb Physical volume "/dev/vdb" changed 1 physical volume(s) resized or updated / 0 physical volume(s) not resized [root@VM ~]# pvs PV VG Fmt Attr PSize PFree /dev/vdb vg_data lvm2 a-- <300.00g <101.00g [root@VM ~]# [root@VM ~]# vgs VG #PV #LV #SN Attr VSize VFree vg_data 1 1 0 wz--n- <300.00g <101.00g