A couple of comments... if this VM is managed by libvirt (recent enough
version is several years old IIRC), you don't need to shut the VM down
or ever touch the image file directly.
To resize a running VM image, you can do:
virsh blockresize vmname /var/lib/libvirt/images/vmname.qcow2 20G
If the VM is using virtio or virtio-scsi drivers, it should see the
change immediately.
If you are running LVM, on recent enough Fedora (I don't know, at least
the last several years), you can then resize without a reboot too. Find
the partition (usually 2 on BIOS or 3 for UEFI boot systems with a
fairly default setup) and device (usually /dev/vda for virtio or
/dev/sda for virtio-scsi), and do (adjusting dev/part):
parted /dev/vda
resizepart 2 100%
quit
pvresize /dev/vda2
Then you need to know your filesystem LV name (like "fedora/root") and
filesystem type (usually ext4, could be xfs if a Server install) and do:
lvresize -l +100%FREE fedora/root
resize2fs /dev/fedora/root -or- xfs_growfs /
And you have more space! I do this all the time with libvirt-managed
Linux VMs. I haven't yet gone through th necessary steps for the more
recent btrfs setup. There's also the possibility of LVM set up with
thin pools... can't remember if that works the same or needs additional
steps.
--
Chris Adams <linux(a)cmadams.net>