Skip to content

Instantly share code, notes, and snippets.

@danton721
Last active April 11, 2024 03:03
Show Gist options
  • Save danton721/07352fd1533a6e8f0fac08b95e9d77ec to your computer and use it in GitHub Desktop.
Save danton721/07352fd1533a6e8f0fac08b95e9d77ec to your computer and use it in GitHub Desktop.

1. Extend KVM partition

(https://computingforgeeks.com/how-to-extend-increase-kvm-virtual-machine-disk-size/)

1.0 Get your VM name

sudo virsh list

1.1 Shutdown your VM

sudo virsh shutdown [NAME]

1.2 Locate disk path

sudo virsh domblklist

1.3 Extend your disk

sudo qemu-img resize [IMAGE-PATH-AND-EXTENSION] +10G

1.4 Start VM

sudo virsh start

2. Extend partition

Check if your volume is using LVM or not. Inside guest VM run the following command:

lsblk

Then check if "vda" has LVM in column type or part

2.1 No LVM:

(https://computingforgeeks.com/resize-ext-and-xfs-root-partition-without-lvm/)

2.1.1 Install dependencies

sudo apt install cloud-guest-utils

2.1.2 Grow partition

sudo growpart [DEVICE (/dev/vda)] [PARTITION-NUMBER (3)]

2.1.3 Resize filesystem

sudo resize2fs [DEVICE-PARTITION (/dev/vda1)]

2.2 LVM type:

(https://computingforgeeks.com/extending-root-filesystem-using-lvm-linux/)

Future todo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment