User Tools

Site Tools


cloud:kvmpartition

KVM Partition Extension

This guide will help to extend hard drive partitions in KVM virtual environment. Please note: in WINDOWS, there is a special partition at the end of the drive partitioning that will block the extension of the standard windows partition. This need to be deleted first before walking this guide. See separate wiki. This guide is focussed on Ubuntu KVM environment.

Shutdown VM

As usual over front end, Or directly over terminal console (already as sudo) by:

virsh shutdown examplevmname 

Once done verify target virtual machine is turned off

virsh list --all

Find Partition Location for VM

To identify the location of the virtual disk for virtual machine do:

virsh domblklist examplevmname 

The output will be something like:

sda /mnt/storage/vmstorage/examplevmname.qcow2

Resizing The Virtual Disk

After founding the location of virtual disk, extend by additing the desired amount of space in Gigabyte, like +64G

qemu-img resize /mnt/storage/vmstorage/examplevmname.qcow2 +64G 

After command, the output should be

Image resized.

Extend Partition In Guest OS

Windows

Switch-on virtual machine, then open Computer Management Utitliy and locate the Disk Management Tool. From here, partition can be extended by right-click on exisiting partition and select “Extend”. Follow this guide for more details:

WINDOWS Delete Partition

Linux

TO BE UPDATED… Read this: https://dev.to/jajera/extending-root-partition-to-use-all-disk-space-in-ubuntu-5a92 Read this: https://computingforgeeks.com/extending-root-filesystem-using-lvm-linux/ Search this: How to extend root filesystem using LVM in ubuntu

cloud/kvmpartition.txt · Last modified: by Todopoderoso

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki