disk image extension of the guest KVM


and on my new cloudmin host, i am facing this message while trying to extend the LVM.. while the guest being shutoff..

Updating virtual disk on /dev/vg0/s1_cloud2_interstellarconsulting_com_img ....
.. update failed : lvextend -L167772160k \/dev\/vg0\/s1_cloud2_interstellarconsulting_com_img failed : Snapshot origin volumes can be resized only while inactive: try lvchange -an Run `lvextend --help' for more information.


I have found this on the internet, but i havent done anything since the last resizing .. i hope i dont have to go through all this to get this back in a working condition.. i have meanwhile tried to reboot but the problem persists.. https://www.linuxquestions.org/questions/linux-server-73/extending-perti...

Closed (fixed)


Was this VM created by cloning another VM? Or was it created entirely fresh from an image?

entirely fresh from an image, rather initially the disk size was 50GB, which i extended to 100GB.. now i want to extend it to 160 GB and that is where i see this issue..

Ok, is there another VM running which is a clone of the one you're trying to expand?

No, rather this cloudmin host only one VM and is it is this one.. no other image or clone exists of this guest VM. I had only changed the name of the host from s1.cloudmin.xxx to server1.xx which should be normal.. dont know if this change of host/identity of the VM causes issues?

The hostname shouldn't matter at all here.

Was this VM perhaps being backed up when you tried to resize it?

No backup, nothing was running during the time, i tried to extend the swap this morning and it worked.. from 2gb to 4gb https://d.pr/i/esulLH

but how do it get it to recognise on the guest, ?

It should be recognized the next time the guest system reboots.

Wow, that is really odd! Could the problem be that the additional 2 GB isn't included in any partition?

I think that is what has happened the additional 2gb(now 4gb) was not included as the swap partition during initial KVM creation.. but i simple created it via cloudmin, dont know why that would happen..

How what would be the procedure to get this corrected? is there a way to recreate this partition again? or somehow to get it recognized? once recognized.. i can then get it expanded.. for example.. need your guidance on this..

You could try shutting down the VM and then expanding that disk a little more, say to 4.1 GB. This will correct the partition table.

thank you this was a simple fix :)

Great! My guess is that the partition didn't get extended the first time, only the disk.

Hi how can we make this full proof? because this is quiet critical if it fails or messes up the existing disk/partition.. anything you can do to improve this behavior in the future release ?

It's hard to say without knowing what caused the resize to be incomplete in the first place.

Actually i thought the problem was resolved but consecutively when i extended the swap partition again it, the guest does not seem to recognize it.. FYI.. i had extended the mail partition of the guest, after which the swap partition stopped showing up on the guest.. its weird..

When doing these extensions, is the VM running the whole time?

ofcourse not, actually..while the VM is running, it does not allow to resize.. so i shutdown.. resize and then reboot to check if it worked.

Status: Fixed ยป Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.