View Single Post
  #7  
Old 23rd January 2009, 19:41
joostvdl joostvdl is offline
Member
 
Join Date: Oct 2005
Posts: 34
Thanks: 0
Thanked 1 Time in 1 Post
Default Current solution

This is how I convert an qemu disk image to an LVM volume. It is to be noted that in the Logical Volume the same partitions are created as in the image file. So directly mounting of an LVM is not possible. To do that use kpartx to create multiple loopback devices which are mountable.

Quote:
# qemu-img convert disk0.qcow2 -O raw disk0.raw
# lvcreate -n server-01_disk0 -L 10G VG01
{10G is total disksize of RAW file as defined in vmbuilder.partation}
{VG01 is name of LVM volume group}

Quote:
# dd if=disk0.raw of=/dev/VG01/server-01_disk0 bs=1M
Change server-01.xml in /etc/libvirt/qemu:
Code:
    <disk type='block' device='disk'>
      <source dev='/dev/VG01/server-01_disk0'/>
      <target dev='hda' bus='ide'/>
    </disk>
Quote:
# virsh define server-01.xml

Last edited by joostvdl; 23rd January 2009 at 19:44.
Reply With Quote