Re: resizing qemu image

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxx>
_______________________________________________
users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx
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@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure



[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux