Increasing VM Disk size
The VM clone template i use is configured to only use a 8GB disk, this is small enough for the Ubuntu Server install and simple apps, and since it is far easier and safer to increase the size of a disk than decrease it, it is better to start with a small disk and increase it. But for larger programs such as Home Assistant and Graylog, 8GB is far too small. For this example I will be increasing the disk for my log-server VM from 8GB to 20GB, the disks are using LVM.
Step 1 - Increase disk size in proxmox
This can be done either via the GUI:
https://docs.themurphywarrens.com/uploads/images/gallery/
2022-07/Jnlimage.png
Or via the host shell:
qm resize <vmID> <Disk> <new disk size>
This new size should be recognized immediately within the VM
sudo dmesg | grep sda
Step 2 - Enlarge the partitions on the virtual disk within the VM
Check the current partition size
sudo fdisk -l /dev/sda | grep ^/dev
Then resize partition 3 and check new partition table
sudo parted /dev/sda
(parted) print
Warning Not all of the space available to /dev/sda appears to be used.......
Fix/Ignore? F
(parted) resizepart 3 100%
(parted) quit
sudo fdisk -l /dev/sda | grep ^/dev
Step 3 - Enlarge the filesystem in the partition on the disk
First we enlarge the physical volume to occupy all available space on the partition
sudo pvresize /dev/sda3
Check Logical Volume path with
sudo lvdisplay
Then enlarge the logical volume and filesystem (this will work with the file system mounted) either by a set amount (5GB)
lvresize --size +5G --resizefs <LV Path>
or fill the disk to capacity
lvresize --extents +100%FREE --resizefs <LV Path>
We can now see the new free space with
df -h








