Skip to content

Instantly share code, notes, and snippets.

@freyes
Created June 25, 2020 15:38
Show Gist options
  • Save freyes/788c4c1e6e9056703e4687038df68d26 to your computer and use it in GitHub Desktop.
Save freyes/788c4c1e6e9056703e4687038df68d26 to your computer and use it in GitHub Desktop.
sudo virsh domblklist $MACHINE
# copy the file path to the qcow2 disk that you want to resize
sudo qemu-img resize $QCOW2_PATH +20G # this will add 20G to the disk
sudo virsh start $MACHINE
# ssh into $MACHINE
lsblk # make sure the disk size is the one you want
sudo apt -y install cloud-guest-utils
sudo growpart /dev/vda 1 # change vda is the disk, and '1' is for the partition number as listed by lsblk.
sudo resize2fs /dev/vda1 # resize the filesystem.
df -h | grep /dev/vda # validate the new size is active.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment