![]() ![]() The output disk is the one created in the previous step. a device, a file, or a URI to a remote disk). Virt-resize takes two mandatory parameters, the input disk and the output disk (both can be e.g. # virsh vol-create-as poolname newvol 10G 5. Or use virsh(1) vol-create-as to create a libvirt storage volume: # virsh pool-list Or use lvcreate(1) to create a logical volume: # lvcreate -L 10G -n lv_name vg_name To store the resized disk image in a file, create a file of a suitable size: # rm -f outdisk You have to have space to store the resized output disk. Virt-resize cannot do in-place disk modifications. (This example is a virtual machine with an 8 GB disk which we would like to expand up to 10 GB). Use virt-filesystems(1) to display the current partitions and sizes: # virt-filesystems -long -parts -blkdevs -h -a /dev/vg/lv_guest If the guest is managed by libvirt, you can use virsh dumpxml like this to find the disk image name: # virsh dumpxml guestname | xpath /domain/devices/disk/source the file or device on the host containing the guest’s disk). Virt-resize -expand /dev/sda2 olddisk newdisk.qcow2ĭETAILED USAGE EXPANDING A VIRTUAL MACHINE DISK 1. This is what you would typically use for Linux guests that use 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: qemu-img create -f qcow2 -o preallocation=metadata newdisk.qcow2 15G Virt-resize -expand /dev/sda2 olddisk newdiskĪs above, but make the /boot partition 200MB bigger, while giving the remaining space to /dev/sda2: virt-resize -resize /dev/sda1= 200M -expand /dev/sda2 \Īs in the first example, but expand a logical volume as the final step. # Note "/dev/sda2" is a partition inside the "olddisk" file. This example takes olddisk and resizes it into newdisk, extending one of the guest’s partitions to fill the extra 5GB of space: 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 first. Virt-resize should not be used on live virtual machines - for consistent results, shut the virtual machine down before resizing it. 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 within. Virt-resize - Resize a virtual machine disk SYNOPSIS virt-resize ] "unknown/unavailable method for expanding the TYPE filesystem on DEVICE/LV". ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |