KVM – Online Disk Resize

By | 31st July 2018

This HOW TO assumes a KVM guest called ‘vm’ backed by an LVM volume called ‘vm-data’.

On Hypervisor

Depending on how the disk is used inside the guest (DRBD disk, partitioned block device, LVM physical volume) continue with one of the three alternatives

On Guest – When Resizing DRBD disk

If the resized disk is a DRBD resource called ‘data’ and has ext4 filesystem on it

On Guest – When Resizing Partitioned Disk

If the resized disk is partitioned block device /dev/vda and we want to resize the last partition /dev/vda3 with ext4 on it

On Guest – When Resizing LVM Physical Volume

If the resized disk has a single partition used as an LVM physical volume.

First we use the parted command from the above ‘When Resizing Partitioned Disk’ steps to resize /dev/vda1, then