Rudi Ahlers
2008-Sep-10 11:43 UTC
[Xen-users] Is it possible to copy the contents of one domU to another domU?
Hi all I hope this can be solved. I have a 50GB CentOS domU, and I want to copy the contents of the domU to another domU, of smaller size (30GB) - is this possible? -- Kind Regards Rudi Ahlers _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Eamonn Kenny
2008-Sep-10 11:50 UTC
Re: [Xen-users] Is it possible to copy the contents of one domU to another domU?
Hi Rudi, Yes if it contains less that 30Gb of data. Run: "ls -lhs /my/xen/partition/directory" to see how much space is used by the domU. Next you need to specify in another e-mail whether you are using LVM (ext3) or loopback files. Then somebody can present a solution. Also, you could change over from loopback to LVM in the process if using LVM for the 50Gb domU. Rudi Ahlers wrote:> Hi all > > I hope this can be solved. > > I have a 50GB CentOS domU, and I want to copy the contents of the domU > to another domU, of smaller size (30GB) - is this possible? > > -- > > Kind Regards > Rudi Ahlers > ------------------------------------------------------------------------ > > _______________________________________________ > Xen-users mailing list > Xen-users@lists.xensource.com > http://lists.xensource.com/xen-users-- _________________ With Best regards, Eamonn Kenny _________________________________________________________________________ Dr. Eamonn M. Kenny, Telephone: 00+353-1-8961536 Webcom-G Manager, Facsimile: 00+353-1-6772204 Computer Architecture Group, Email: Eamonn.Kenny@cs.tcd.ie Computer Science Department, www: http://www.cs.tcd.ie/Eamonn.Kenny Rm-005, CALab1, INS building, Map: http://www.tcd.ie/Maps/lloyd.html TCD, Dublin 2, Ireland. Map: http://www.tcd.ie/Maps/tcd_east.html _________________________________________________________________________ _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Eamonn Kenny
2008-Sep-10 13:36 UTC
Re: [Xen-users] Is it possible to copy the contents of one domU to another domU?
Hi Rudi, # create two directories for mount points mkdir -p /mnt/oldroot /mnt/newroot # create the 30G LVM lvcreate -L 30G -n VolGroup00-LogVol01 /dev/VolGroup00 mkfs -t ext3 /dev/VolGroup00-LogVol01 # mount both LVMs mount /dev/mapper/VolGroup00--LogVol00 /mnt/oldroot mount /dev/mapper/VolGroup00--LogVol01 /mnt/newroot # sync the data rsync -au /mnt/oldroot/* /mnt/newroot Alternatively use cp -ax as described in the Xen manual. #unmount partitions umount /mnt/oldroot # change networking on new domU chroot /mnt/newroot edit /etc/hosts, /etc/resolv.conf, /etc/sysconfig/network, /etc/sysconfig/network-scripts/ifcfg-* exit umount /mnt/newroot Hope the syntax is right, but you get the idea... Rudi Ahlers wrote:> Hi all > > I hope this can be solved. > > I have a 50GB CentOS domU, and I want to copy the contents of the domU > to another domU, of smaller size (30GB) - is this possible? > > -- > > Kind Regards > Rudi Ahlers > ------------------------------------------------------------------------ > > _______________________________________________ > Xen-users mailing list > Xen-users@lists.xensource.com > http://lists.xensource.com/xen-users-- _________________ With Best regards, Eamonn Kenny _________________________________________________________________________ Dr. Eamonn M. Kenny, Telephone: 00+353-1-8961536 Webcom-G Manager, Facsimile: 00+353-1-6772204 Computer Architecture Group, Email: Eamonn.Kenny@cs.tcd.ie Computer Science Department, www: http://www.cs.tcd.ie/Eamonn.Kenny Rm-005, CALab1, INS building, Map: http://www.tcd.ie/Maps/lloyd.html TCD, Dublin 2, Ireland. Map: http://www.tcd.ie/Maps/tcd_east.html _________________________________________________________________________ _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Chris Edwards
2008-Oct-27 14:56 UTC
RE: [Xen-users] Is it possible to copy the contents of one domU to another domU?
In this section.... # mount both LVMs mount /dev/mapper/VolGroup00--LogVol00 /mnt/oldroot mount /dev/mapper/VolGroup00--LogVol01 /mnt/newroot The system tells me that I need to specify the file system type. For the life of me I cannot determine the file system type. Any hints would be appreciated. Thanks! --- Chris Edwards -----Original Message----- From: xen-users-bounces@lists.xensource.com [mailto:xen-users-bounces@lists.xensource.com] On Behalf Of Eamonn Kenny Sent: Wednesday, September 10, 2008 9:37 AM To: Rudi Ahlers Cc: xen-users@lists.xensource.com Subject: Re: [Xen-users] Is it possible to copy the contents of one domU to another domU? Hi Rudi, # create two directories for mount points mkdir -p /mnt/oldroot /mnt/newroot # create the 30G LVM lvcreate -L 30G -n VolGroup00-LogVol01 /dev/VolGroup00 mkfs -t ext3 /dev/VolGroup00-LogVol01 # mount both LVMs mount /dev/mapper/VolGroup00--LogVol00 /mnt/oldroot mount /dev/mapper/VolGroup00--LogVol01 /mnt/newroot # sync the data rsync -au /mnt/oldroot/* /mnt/newroot Alternatively use cp -ax as described in the Xen manual. #unmount partitions umount /mnt/oldroot # change networking on new domU chroot /mnt/newroot edit /etc/hosts, /etc/resolv.conf, /etc/sysconfig/network, /etc/sysconfig/network-scripts/ifcfg-* exit umount /mnt/newroot Hope the syntax is right, but you get the idea... Rudi Ahlers wrote:> Hi all > > I hope this can be solved. > > I have a 50GB CentOS domU, and I want to copy the contents of the domU > to another domU, of smaller size (30GB) - is this possible? > > -- > > Kind Regards > Rudi Ahlers > ------------------------------------------------------------------------ > > _______________________________________________ > Xen-users mailing list > Xen-users@lists.xensource.com > http://lists.xensource.com/xen-users-- _________________ With Best regards, Eamonn Kenny _________________________________________________________________________ Dr. Eamonn M. Kenny, Telephone: 00+353-1-8961536 Webcom-G Manager, Facsimile: 00+353-1-6772204 Computer Architecture Group, Email: Eamonn.Kenny@cs.tcd.ie Computer Science Department, www: http://www.cs.tcd.ie/Eamonn.Kenny Rm-005, CALab1, INS building, Map: http://www.tcd.ie/Maps/lloyd.html TCD, Dublin 2, Ireland. Map: http://www.tcd.ie/Maps/tcd_east.html _________________________________________________________________________ _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Agent Rooker
2008-Oct-28 17:05 UTC
Re: [Xen-users] Is it possible to copy the contents of one domU to another domU?
I''m a little confused, are you doing these steps in dom0 or your centos domU? If you''re doing it in dom0, this message might indicate that your logical volume is attached to the domU as a hard drive rather than as a partition. As such, it will have a partition table and potentially a bunch of different partitions. To make matters worse, if you installed from a disk (i.e., not from a template) and you used the default partitioning scheme, you probably have LVM set up in domU. This means you have nested LVMs, and you''ll have to figure out some way to mount your nested domU filesystem in dom0 if you want to follow these steps from dom0. When I decided to move away from nested LVMs in my centos domUs, I found this message extremely helpful. http://lists.xensource.com/archives/html/xen-users/2008-09/msg00594.html I think these steps (with some modification) might help you to migrate your files to a smaller filesystem. But to say for sure, I would need to know more about your setup. On Mon, Oct 27, 2008 at 9:56 AM, Chris Edwards <cedwards@smartechcorp.net> wrote:> In this section.... > > # mount both LVMs > mount /dev/mapper/VolGroup00--LogVol00 /mnt/oldroot > mount /dev/mapper/VolGroup00--LogVol01 /mnt/newroot > > The system tells me that I need to specify the file system type. For the life of me I cannot determine the file system type. Any hints would be appreciated. > > Thanks! > --- > > Chris Edwards > > > -----Original Message----- > From: xen-users-bounces@lists.xensource.com [mailto:xen-users-bounces@lists.xensource.com] On Behalf Of Eamonn Kenny > Sent: Wednesday, September 10, 2008 9:37 AM > To: Rudi Ahlers > Cc: xen-users@lists.xensource.com > Subject: Re: [Xen-users] Is it possible to copy the contents of one domU to another domU? > > Hi Rudi, > > # create two directories for mount points > mkdir -p /mnt/oldroot /mnt/newroot > > # create the 30G LVM > lvcreate -L 30G -n VolGroup00-LogVol01 /dev/VolGroup00 > mkfs -t ext3 /dev/VolGroup00-LogVol01 > > # mount both LVMs > mount /dev/mapper/VolGroup00--LogVol00 /mnt/oldroot > mount /dev/mapper/VolGroup00--LogVol01 /mnt/newroot > > # sync the data > rsync -au /mnt/oldroot/* /mnt/newroot > Alternatively use cp -ax as described in the Xen manual. > > #unmount partitions > umount /mnt/oldroot > > # change networking on new domU > chroot /mnt/newroot > edit /etc/hosts, /etc/resolv.conf, /etc/sysconfig/network, > /etc/sysconfig/network-scripts/ifcfg-* > exit > umount /mnt/newroot > > Hope the syntax is right, but you get the idea... > > Rudi Ahlers wrote: >> Hi all >> >> I hope this can be solved. >> >> I have a 50GB CentOS domU, and I want to copy the contents of the domU >> to another domU, of smaller size (30GB) - is this possible? >> >> -- >> >> Kind Regards >> Rudi Ahlers >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Xen-users mailing list >> Xen-users@lists.xensource.com >> http://lists.xensource.com/xen-users > > > -- > _________________ > With Best regards, > Eamonn Kenny > > _________________________________________________________________________ > Dr. Eamonn M. Kenny, Telephone: 00+353-1-8961536 > Webcom-G Manager, Facsimile: 00+353-1-6772204 > Computer Architecture Group, Email: Eamonn.Kenny@cs.tcd.ie > Computer Science Department, www: http://www.cs.tcd.ie/Eamonn.Kenny > Rm-005, CALab1, INS building, Map: http://www.tcd.ie/Maps/lloyd.html > TCD, Dublin 2, Ireland. Map: http://www.tcd.ie/Maps/tcd_east.html > _________________________________________________________________________ > > > _______________________________________________ > Xen-users mailing list > Xen-users@lists.xensource.com > http://lists.xensource.com/xen-users > > _______________________________________________ > Xen-users mailing list > Xen-users@lists.xensource.com > http://lists.xensource.com/xen-users >-- Agent Rooker _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users