Here is how to extend VM disk size with virsh
which is using qcow2
format.
- Shutdown your VM.
- Get the disk path:
ShellScript
virsh domblklist $VM_NAME
In my case it’s DISK_PATH=/mnt/sdb/vm-disk-07.qcow2
.
- Increase disk size:
ShellScript
qemu-img resize $DISK_PATH +150G
- Start the VM;
- Login to the VM;
- Grow the VM disk size (if it’s not already automatically):
ShellScript
# for my configuration
growpart /dev/vda 1
resize2fs /dev/vda1
Leave a Reply