Resizing/Extending Logical Volumes (LVM) in Proxmox
What is LVM?
LVM stands for Logical Volume Management. It is a system of managing logical volumes, or filesystems, that is much more advanced and flexible than the traditional method of partitioning a disk into one or more segments and formatting that partition with a filesystem. - https://wiki.ubuntu.com/Lvm
Warning
Below are the steps I took when I replaced my Proxmox Backup Server 30GB SSD with a 400GB and cloned the installation from the old card to the new one. Do not attempt these steps without first having a backup as there is a high risk of data loss if the partition changes are unsuccessful
Extending a LVM Volume
Log into the device using LVM, in this example I'll be extending the pbs-root and data volumes in Proxmox Backup Server
Run the following commands in terminal
# login as root if needed (not needed for proxmox)sudosu
# list disks and partitionsfdisk-l
# list volume groupsvgdisplay
# list logical volumeslvdisplay
# edit partitions with fdisk, change device id as neededfdisk/dev/sda
# print the partition tablep
# delete a partitiond
# enter the lvm partition number3# create a new partitionn
# enter the new partition number, same as the number deleted3# press enter to accept the default first sector# press enter to accept the default last sector# when prompted about removing the LVM signature, enter Nn
# set the partition typet
# enter the partition number3# set the type to Linux LVM43# write the changesw
# list disks and partitions, noting the size increasefdisk-l
# extend the existing physical volumepvresize/dev/sda3
# extend the pbs-root logical volume to 100% available free spacelvextend-l+100%FREE/dev/pbs/root
# extend the underlying file systemresize2fs/dev/mapper/pbs-root
# list logical volumeslvdisplay