You have to have space to store the resized output disk. Virt-resize cannot do in-place disk modifications. dev/sda device 8.0G -(This example is a virtual machine with an 8 GB disk which we would like to expand up to 10 GB ). # virt-filesystems -long -parts -blkdevs -h -a /dev/vg/lv_guest ![]() Use virt-filesystems(1) to display the current partitions and sizes: # virsh dumpxml guestname | xpath /domain/devices/disk/source If the guest is managed by libvirt, you can use "virshĭumpxml" like this to find the disk image name: the file or device on the host containing the guest's disk). Virt-resize -expand /dev/sda2 olddisk newdisk.qcow2 Detailed UsageĮXPANDING A VIRTUAL MACHINE DISK 1. Qemu-img create -f qcow2 newdisk.qcow2 15G LVM: virt-resize -expand /dev/sda2 -LV-expand /dev/vg_guest/lv_root \Īs in the first example, but the output format will be qcow2 instead of a raw disk: This is what you would typically use for Linux guests that use Virt-resize -resize /dev/sda1= 200M -expand /dev/sda2 \Īs in the first example, but expand a logical volume as the final step. Virt-resize -expand /dev/sda2 olddisk newdisk 2.Īs above, but make the /boot partition 200MB bigger, while giving the remaining space to /dev/sda2: # Note "/dev/sda2" is a partition inside the "olddisk" file. Virt-filesystems -long -h -all -a olddisk ![]() If you are not familiar with the associated tools: virt-filesystems(1) and virt-df(1), we recommend you go and read those manual pagesĬopy "olddisk" to "newdisk", extending one of the guest's partitions to fill the extra 5GB of space. Virt-resize should not be used on live virtual machines - for consistent results, shut the ![]() Virt-resize cannot resize disk images in-place. Virt-resize is a tool which can resize a virtual machine disk, making it larger or smaller overall, and resizing or deleting any partitions contained Virt-resize - Resize a virtual machine disk
0 Comments
Leave a Reply. |