KVM LVM partition resize

I'm trying to use Cloudmin's "Manage Disks" function to resize the image of a KVM virtual machine.

The image is on a LVM Volume, with a /boot (hda1) and a / (hda2) partition.

Cloudmin answers : ".. update failed : Only the last partition on a disk image can be resized"

Is there a way to resize such a VM filesystem ?

Status: 
Closed (fixed)

Comments

Does this virtual disk only have 2 partitions?

I would be interested to see the output of fdisk -l /dev/hda run inside the VM.

Yes, as said there's 2 partitions on the disk (/boot and /). Here's the output of fdisk -l /dev/hda :

/dev/hda1   *           1          14      112423+  83  Linux
/dev/hda2              15         261     1984027+  83  Linux

That looks OK ..

What does the /etc/fstab file contain on the VM ?

Here :

[root@sql ~]# cat /etc/fstab

/dev/hda1 / ext3 defaults 1 1

LABEL=/boot /boot ext3 defaults 1 2

tmpfs /dev/shm tmpfs defaults 0 0

devpts /dev/pts devpts gid=5,mode=620 0 0

sysfs /sys sysfs defaults 0 0

proc /proc proc defaults 0 0

That seems in-consistent with the partition table above .. if /dev/hda1 is mounted on / , why is it so small in the partition table?

What does the mount command output?

Yes, it's true that's inconsistent...

This VM was built from a 2Gb system image. The file system in the original image had /boot on /dev/hda1, and / on /dev/hda2, as in the first output above.

Something must've been going wrong during the creation of the VM.

Here : [root@sql ~]# mount

/dev/hda1 on / type ext3 (rw)

proc on /proc type proc (rw

sysfs on /sys type sysfs (rw)

devpts on /dev/pts type devpts (rw,gid=5,mode=620)

/dev/hda1 on /boot type ext3 (rw)

tmpfs on /dev/shm type tmpfs (rw)

none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)

sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)

I don't even understand why the vm boots !

Should we create system images with a single / partition ?

That mount output looks crazy - it has /dev/hda1 listed twice!

Yes, I strongly recommend creating VMs with just a single / partition. Unless you have a huge disk (which is unlikely for a VM), there is no need for a separate /boot .

OK. I think I'll have to recreate the system image from scratch.

If I do so, will I be able to resize LVM partitions via Cloudmin ?

Yes, partition resizes will work (on LVM or regular files) as long as the disk contains a single partition..

OK. Thanks again. Had to stay up a little late (I'm in Switzerland...), but it was worth it. I'll take care of that system image tomorrow... ;)

Cheers,

Miguel.

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