migrating a LVM based xen domU to a file based image

1) shut down the domU
2) from the dom0, mount the LVM volume:

% /dev/vg0/web.isber /mnt/web.isber

3) use dd to convert the LVM volume to an image file

% [vm2:~]# dd if=/dev/mapper/vg0-web.isber of=/lots-of-storage/web.isber-disk.img

4) you can now copy or move this .img file to another xen dom0 and boot using:

--/etc/xen/hostname.cfg--
#
#  Disk device(s).
#
root        = '/dev/hda1 ro'
disk        = [
                  'tap:aio:/var/xen/images/domains/web.isber/swap.img,hda2,w',
                  'tap:aio:/var/xen/images/web-disk.img,hda1,w',
              ]
--/etc/xen/hostname.cfg--

Powered by WordPress | Designed by Elegant Themes