[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-users] how to copy a guest



ma qiang wrote:

    I have installed xen on the computer, and adopted LVM as domU's
storage devices. I have installed a centos for the domU, now I want to
copy this system as another domU, Who can tell me how?

I'm assuming you've used LVM to create separate volumes for each DomU.

There is probably a way to get LVM to clone a drive - it's not something I've done, and would require you shut down the guest first so as to have a clean filesystem.

The way I do it is to create the new volumes for the new guest, create the filesystems, and mount them in Dom0 - eg mount guest2root on /mnt, guest2var on /mnt/var and so on. Then I use rsync to copy the existing guests filesystem into the ones mounted on Dom0 - this can be done with the guest running though you will end up with some temporary files copied.
From Dom0 you'd use the command :
rsync -avHx root@guest1:/ /mnt/
rsync -avHx root@guest1:/var/ /mnt/var/

Or from the guest you'd do it like :
rsync -avHx / root@dom0:/mnt/
rsync -avHx /var/ root@dom0:/mnt/var/

Note the trailing '/' on the paths, it makes a difference to how rsync copies the files.

Alternatively, you can stop the existing guest and mount it's filesystems in Dom0 as well, eg guest1root on /mnt1, guest2var on /mnt1/var.
rsync -avHx /mnt1/ /mnt2/
rsync -avHx /mnt1/var/ /mnt2/var/

Or there are other tools you can use, a lot depends on your preferences.
cpio will do it, cp will do it with recursive and preserve options set.

--
Simon Hobson

WANTED: "Software CD ROM Kit" for Canon CLBP 360-PS printer (Canon part no RH6-3612, or possibly RH6-3810, or RH6-3610 might do). I've a dead HD and need this CD so I can replace the disk and re-install the printer OS on it. If anyone knows where I might get hold of one I'd be grateful - requests to Canon drew a blank, it's been out of support for years. Alternatively, if anyone has one of these and would let me image their hard disk ...

Visit http://www.magpiesnestpublishing.co.uk/ for books by acclaimed
author Gladys Hobson. Novels - poetry - short stories - ideal as
Christmas stocking fillers. Some available as e-books.

_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.