Expand Disk on VM
Example OS: Ubuntu
Make sure to adjust the LV, PV, dev name before run the command.
Resize in Proxmox UI
Section titled “Resize in Proxmox UI”Resize the file system in UI, under VM -> Hardware -> Click on the disk to resize, click “Resize disk” button.
Check Capacity on Partition
Section titled “Check Capacity on Partition”Confirm increase in disk space (1TB in my case):
lsblkOutput:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTsda 8:0 0 1T 0 disk├─sda1 8:1 0 1M 0 part├─sda2 8:2 0 1G 0 part /boot└─sda3 8:3 0 1T 0 part └─ubuntu--vg-ubuntu--lv 253:0 0 31G 0 lvm /Resize Partition
Section titled “Resize Partition”Resize the partition using parted
sudo partedOutput:
GNU Parted 3.3Using /dev/sdaWelcome to GNU Parted! Type 'help' to view a list of commands.(parted) resizepart 3 100%(parted) quitInformation: You may need to update /etc/fstab.Expand LV
Section titled “Expand LV”Extend the logical volume now
sudo lvextend -r -l +100%FREE /dev/mapper/ubuntu--vg-ubuntu--lvOutput:
Size of logical volume ubuntu-vg/ubuntu-lv changed from <31.00 GiB (7935 extents) to 1.03 TiB (270079 extents). Logical volume ubuntu-vg/ubuntu-lv successfully resized.resize2fs 1.45.5 (07-Jan-2020)Filesystem at /dev/mapper/ubuntu--vg-ubuntu--lv is mounted on /; on-line resizing requiredold_desc_blocks = 4, new_desc_blocks = 132The filesystem on /dev/mapper/ubuntu--vg-ubuntu--lv is now 276560896 (4k) blocks long.Expand PV
Section titled “Expand PV”Resize the physical volume (may or may not need)
sudo pvresize /dev/sda3Output:
Physical volume "/dev/sda3" changed1 physical volume(s) resized or updated / 0 physical volume(s) not resizedCheck Capacity on Partition after Resizing
Section titled “Check Capacity on Partition after Resizing”Confirm resize complete
$ lsblkOutput:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTsda 8:0 0 1T 0 disk├─sda1 8:1 0 1M 0 part├─sda2 8:2 0 1G 0 part /boot└─sda3 8:3 0 1T 0 part └─ubuntu--vg-ubuntu--lv 253:0 0 1T 0 lvm /Reference: link