2

After expanding the size of the disk on my Proxmox hypervisor from 8GB to 18GB I am trying to see this new space on my Ubuntu 20.04 VM: enter image description here

These are the commands I'd run on the VM

# Physical volume is called /dev/sda3
sudo pvs

resize the Physical Volume (PV)

sudo pvresize /dev/sda3

root logical volume is

df -h

expand the logical volume

sudo lvextend -r -l +100%FREE /dev/mapper/ubuntu--vg-ubuntu--lv

resize my number 3 partition (this gave me 17GB on sda3)

sudo growpart /dev/sda 3

enter image description here

I can see it on the sda3 partition!

enter image description here

Want to see the 18GB on /dev/mapper/ubuntu--vg-ubuntu--lv

https://unix.stackexchange.com/a/583544 - am following these instructions

Any pointers would be great!

2 Answers2

12

https://packetpushers.net/ubuntu-extend-your-default-lvm-space/ was the article which helped me the most.

In summary

# allocate more space on hypervisor

make the partition see the space (dev/sda3, Resize, Write, quit)

sudo cfdisk

extend the physical volume from the partition

sudo pvresize /dev/sda3

extend LV to use up all space from VG

sudo lvextend -l +100%FREE /dev/ubuntu-vg/ubuntu-lv

resize file system

sudo resize2fs /dev/ubuntu-vg/ubuntu-lv

check can see the space on filesystem

df -h

1

Do the following to increase volume size.

  • Increase/resize disc from GUI console

  • Identify Linux partition:

    sudo fdisk -l
    
  • Extend physical drive partition

    growpart /dev/sda 3
    
  • Instruct LVM that disk size has changed

    sudo pvresize /dev/sda3
    
  • Find Entry with starting LV

    lvdisplay
    
  • Resize LV

    sudo lvextend -l +100%FREE /dev/ubuntu-vg/ubuntu-lv
    sudo resize2fs /dev/ubuntu-vg/ubuntu-lv
    
AdminBee
  • 22,803
FlyingV
  • 111