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 <li...@cmadams.net>
_______________________________________________
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure

Reply via email to