I have a Linux guest that uses an LVM volume directly as root file system (that is, there is no partition table). libvirt config looks thus:

  <type arch='x86_64' machine='rhel6.4.0'>hvm</type>
  <cmdline>console=ttyS0 root=/dev/vda</cmdline>
  <boot dev='hd'/>

<disk type='block' device='disk'>
  <driver name='qemu' type='raw' cache='none' io='native'/>
  <source dev='/dev/vg/guest'/>
  <target dev='vda' bus='virtio'/>
  <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>

From inside the guest:

$ mount
/dev/vda on / type ext4 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)

Is it possible to resize the guest's root partition without rebooting the guest? Just doing lvextend on the host and resize2fs from the guest does not seem to be enough.


Yes, you need to use virsh blockresize to notify the guest of the change.

The syntax should be something like:

virsh blockresize INSTANCE_NAME --path /dev/vg/guest --size NEWSIZEG
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.