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

Re: [Fedora-xen] How to duplicate virtual machines installed on a entire partition?



On Sun, Nov 05, 2006 at 01:42:33PM -0200, Walter Souto wrote:
> Hi,
> 
> First, I'm sorry if that subject has been explored here before. I'd check
> the list on a few last months and found nothing, so...
> 
> I'm currently using FC6 and did use virt-manager to install one vm on a
> partition /dev/sda5 (not a file) using the default layout inside this
> filesystem. So, there's a way to duplicate the entire /dev/sda5 to /dev/sda6
> for example? I think I can copy the entire partition using gnu-parted or
> something, but I'm not sure if it's the best way.

If you ensure that sda5 & sda6  are *absolutely* identical in their size
(check number of blocks allocated to each in fdisk), then you ought to 
simple be able to copy one to the other using dd. 

  eg    dd if=/dev/sda5 of=/dev/sda6

Be very careful not to typo there though :-)

> What I'm looking for is a way to create a image of the entire filesystem
> that I can simple restore to another partition and boot it up with xen. What
> you guys usually doing about that? I'm not sure if dump can do that, so I
> tried dump without sucess (I'm not know what I'm doing for sure).

You can also just copy the partition to a file, which you can then move
around at will, eg

    dd if=/dev/sda5  of=/path/to/some/file.img

You could even then just run a VM off 'file.img' using the regular Xen
file image driver (file: or tap:aio:  in xen config file for disks).

Regards
Dan.
-- 
|=- Red Hat, Engineering, Emerging Technologies, Boston.  +1 978 392 2496 -=|
|=-           Perl modules: http://search.cpan.org/~danberr/              -=|
|=-               Projects: http://freshmeat.net/~danielpb/               -=|
|=-  GnuPG: 7D3B9505   F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505  -=| 


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