

increase the total disk image size from 20 GB to 30 GB,.To print the partition details and their size of a disk image, run: $ virt-filesystems -long -parts -blkdevs -h -a centos8.qcow2ĭisplay current partitions and their sizes using virt-filesystems command in LinuxĪs you can see in the above output, my disk image has only two partitions, namely /dev/sda1 with size 1 GB and /dev/sda2 with 19GB. Replace centos8 with your VM name in the above command.Īfter locating the disk image you want to resize, inspect the partition details inside this disk image. You can use virsh dumpxml command to locate the disk image that you want to resize. I have stored this mage in my current working directory. Expand or extend KVM virtual machine disk size in Linuxįor the purpose of this guide, I will be using CentOS 8 virtual machine disk image named centos8.qcow2.

Now let us see how to expand virtual machine disk size using virt-resize command. So if you're on Fedora 34, install guestfs-tools package like below: $ sudo dnf install guestfs-tools In Fedora 34, guestfs-tools package provides virt-resize tool. To install libguestfs-tools package on Fedora, RHEL and its clones, run: $ sudo dnf install libguestfs-tools To install libguestfs-tools package on Debian, Ubuntu and its derivatives, run: $ sudo apt install libguestfs-tools Virt-resize is the part of the libguestfs-tools package. And then we copy the source image to the destination image and finally resize it. To expand a Virtual machine's disk size, we first create a larger disk image than the source image. The guest systems should be turned off before resizing their disk images. Please note that virt-resize the live machines. We can also delete the partitions inside the virtual disk with virt-resize command. Using virt-resize, we can either increase or decrease the size of a virtual machine's disk. Virt-resize is a command line tool to resize a virtual machine disk.
