Adventures in Disk Resizing

I just finished installing a fancy new SSD for my VM's to use in my r710. After getting that detected and used by Proxmox I migrated my high i/o VM's there and admired a job well done.

However, One of my VM's the one I use for all my docker activities, was running out of space. I had given it 12GB originally and that was not enough anymore, I had about 450MB left before running out. So I had to look up how to do that.

I used this website primarily. Basically I had to first expand the virtual disk in Proxmox, then I had to go into the VM and expand the existing partition to utilize the new space.

# First, inside of the proxmox shell

# qm resize <vmid> <disk> <size>
qm resize 107 scio0 +7GB

# Then, inside of the resized VM

sudo parted
resizepart 1

resize2fs /dev/sda1

And that's it! In my situation, I only had one partition in my VM which I did not set up as an LVM. If you have an LVM partition then arguably it would have been a tad easier. You would also use a different command to resize as the final step pvresize /dev/sda1 would be the right command. Obviously replace the sda1 with the partition you want to resize.

Some additional information from this post here has some steps for LVM resizing as well.

# To check if the disk you expanded got to the logical volume
df -kh

# Resize the disk itself
growpart /dev/sda 1

# check that changes are reflected

# Check the LVM path
sudo lvdisplay

# Extend the Logical Volume after finding the path
lvextend -l +100%FREE /path/

# Resize the filesystem for the logical path
resize2fs  /path/

Now all that's left is to monitor the new SSD and resized partition and make sure that everything is working as intended. Backups were made before I attempted all this so if anything goes wrong then I should be good!