Mount qcow2 image
Enable NBD on the host.
sudo modprobe nbd max_part=8Connect qcow2 image as a network block device.
sudo qemu-nbd --connect=/dev/nbd0 /path/to/image.qcow2Find the VM’s partitions.
sudo fdisk /dev/nbd0 -lMount the partition from the VM.
sudo mount /dev/nbd0p3 /mnt/pointTo unmount:
sudo umount /mnt/point
sudo qemu-nbd --disconnect /dev/nbd0
sudo rmmod nbdResize qcow2 image
Install guestfs-tools (required for virt-resize command).
sudo dnf install -y guestfs-tools
sudo apt install -y guestfs-tools libguestfs-toolsTo resize qcow2 images, you’ll have to create a new qcow2 image with the size you want, then use virt-resize on the old qcow2 image to the new one.
You’ll need to know the root partition within the old qcow2 image.
Create a new qcow2 image with the size you want.
qemu-img create -f qcow2 -o preallocation=metadata newdisk.qcow2 100GNow resize the old one to the new one.
virt-resize --expand /dev/vda3 olddisk.qcow2 newdisk.qcow2Once you boot into the new qcow2 image, you’ll probably have to adjust the size of the logical volume if it has LVM.
sudo lvresize -l +100%FREE /dev/mapper/sysvg-rootThen resize the XFS root partition within the logical volume.
sudo xfs_growfs /dev/mapper/sysvg-root