Complete guide to extend guest disk from backend, LVM and Filesystem inside KVM guest.

First of all this is my guest system layout. There is a disk called ‘vda’ where my guest filesystem reside.


IN GUEST

Two guest logical volumes ‘fedora-swap’ and ‘fedora-root’ are created inside guest physical volume vda. Discard ‘fedora-swap’ for now.

The physical volume layout is shown below:

Now guest image is on a file in host filesystem called ‘nested-guest-f18’.

If your guest system is on a Logical Volume in your host system please refer this article

If I check ‘qemu-img’ information on this guest disk file, I can see

in HOST

So, virtual size is “6.0” G and its a sparse file.

Let me resize the size from qemu-img resize command

Image resized.

Check it now:

Looks good..

Now, the changes have been reflected inside guest as you can see in fdisk output..

How-ever LVM layout looks same :

Now, lets create a new partition on vda called vda3.

Let me toggle the partition type to LVM :

Once its done, lets create a PV on vda3

Its the turn to extend the fedora volume group..

Now lets extend the logical volume called ‘root’ :

Once the underlying LVM have enough space, lets try to increase the ext filesystem onlne..

LVM layer list the new layout with increased space of logical volumes..

All good ? if you have any doubts, please feel free to ask in comments section..

One Reply to “Complete guide to extend guest disk from backend, LVM and Filesystem inside KVM guest.”

Leave a Reply

Your email address will not be published. Required fields are marked *