[libvirt-users] Mapping partitions rather than disks into a Libvirt managed KVM guest

Steven Ellis mail_lists at stevencherie.net
Thu Dec 23 22:51:37 UTC 2010


I'm trying to migrate some XEN based environments over to KVM and I'm
having a couple of issues with how I'm currently managing the
storage  

On my Xen Server I have a bunch of LVM based partitions that are mapped
into the guests as partitions rather than disks  

For example  

 /dev/VIrtVG/server-home maps to /dev/sda2 which is mounted as /home in the
guest.  

Is there a simple way to reproduce this using KVM and libvirt rather than
needing enough spare space to turn each of these partitions into virtual
disks.  

One method I've tried is using mdadm with linear to create a partition
table stub but i'm a little worries about data integrity.  

 dd if=/dev/zero of=/root/dummy.mbr count=256  

 losetup -f /root/dummy.mbr   

 mdadm --build --verbose /dev/md0 --chunk=128 --level=linear
--raid-devices=2 /dev/loop0 /dev/VIrtVG/server-home  

Then try to setup a partition table with fdisk.  

Any other recommendations?   

Thanks

 Steve  





More information about the libvirt-users mailing list