Mount qcow2 image
Enable NBD on the host.
1sudo modprobe nbd max_part=8Connect qcow2 image as a network block device.
1sudo qemu-nbd --connect=/dev/nbd0 /path/to/image.qcow2Find the VM’s partitions.
1sudo fdisk /dev/nbd0 -lMount the partition from the VM.
1sudo mount /dev/nbd0p3 /mnt/pointTo unmount:
1sudo umount /mnt/point
2sudo qemu-nbd --disconnect /dev/nbd0
3sudo rmmod nbdResize qcow2 image
Install guestfs-tools (required for virt-resize command).
1sudo dnf install -y guestfs-tools
2sudo 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.
1qemu-img create -f qcow2 -o preallocation=metadata newdisk.qcow2 100GNow resize the old one to the new one.
1virt-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.
1sudo lvresize -l +100%FREE /dev/mapper/sysvg-rootThen resize the XFS root partition within the logical volume.
1sudo xfs_growfs /dev/mapper/sysvg-root