Xen: extend lvm of virtual machine

First: Make sure to shut down the virtual machine or to unmount the disk inside it. Once finished you can start to extend the logical volume on the hypervisor:

lvextend -L+400G /dev/vg0/disk
e2fsck -f /dev/vg0/disk
resize2fs /dev/vg0/disk

In case you shut down the virtual machine you may start it again with

xm create -c /path/to/config.cfg

which will not only start the virtual machine but also attach you to its console. If you have verified that the disk is now as large as you wanted it to be you can detach from the console with

CTRL + ]
This entry was posted in Debian, lvm, Xen. Bookmark the permalink.