Hi folks, I am trying to manually clone a windows HVM. Here are the steps I followed. I am trying to clone a windows HVM running on /dev/VolGroup00/windows to another LV /dev/VolGroup00/swindows 1) losetup -o (63 * 512) /dev/loop6 /dev/VolGroup00/windows 2) ntfsclone --save-image -O myfile.img /dev/loop6 3) losetup -d /dev/loop6 4) parted /dev/VolGroup00/swindows mklabel msdos 5) parted /dev/VolGroup00/swindows unit s mkpart primary ntfs 0 6666666 set 1 boot on 6) losetup -o (63 * 512) /dev/loop7 /dev/VolGroup00/swindows 7) ntfsclone --restore-image -O /dev/loop7 myfile.img 8) losetup -d /dev/loop7 Then I tried to start the VM out of the new LV (swindows). I got an error: A disk read error occurred at the beginning. Basically the problem seems to be with the disk image I created with parted. ntfsclone is working fine, if I write it back on the same LV. Does anyone here know how to create a bootable disk image for windows. Using ntfs-utils you can cleanly copy the file system alone into a partition, otherwise you end up losing the ability to manipulate the disk size easily. Thanks. _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Artur Linhart - Linux communication
2007-Jun-20 23:01 UTC
RE: [Xen-users] Cloning a Windows VM
Hello, Is it impossible just to create new logical volume of the same size with lvcreate and simply copy with dd all bytes from the old LV to the new one and only modify the configuration file to read from the new physical device? (or to create the modifiable snapshot logical volume) I think this could work - the partition itself should know nothing about the physical location where and how it really runs... Or am I wrong? With regards, Archie -----Original Message----- From: xen-users-bounces@lists.xensource.com [mailto:xen-users-bounces@lists.xensource.com] On Behalf Of Ligesh Sent: Wednesday, June 20, 2007 1:13 AM To: Xen Users Subject: [Xen-users] Cloning a Windows VM Hi folks, I am trying to manually clone a windows HVM. Here are the steps I followed. I am trying to clone a windows HVM running on /dev/VolGroup00/windows to another LV /dev/VolGroup00/swindows 1) losetup -o (63 * 512) /dev/loop6 /dev/VolGroup00/windows 2) ntfsclone --save-image -O myfile.img /dev/loop6 3) losetup -d /dev/loop6 4) parted /dev/VolGroup00/swindows mklabel msdos 5) parted /dev/VolGroup00/swindows unit s mkpart primary ntfs 0 6666666 set 1 boot on 6) losetup -o (63 * 512) /dev/loop7 /dev/VolGroup00/swindows 7) ntfsclone --restore-image -O /dev/loop7 myfile.img 8) losetup -d /dev/loop7 Then I tried to start the VM out of the new LV (swindows). I got an error: A disk read error occurred at the beginning. Basically the problem seems to be with the disk image I created with parted. ntfsclone is working fine, if I write it back on the same LV. Does anyone here know how to create a bootable disk image for windows. Using ntfs-utils you can cleanly copy the file system alone into a partition, otherwise you end up losing the ability to manipulate the disk size easily. Thanks. _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users __________ Informace od NOD32 2340 (20070620) __________ Tato zprava byla proverena antivirovym systemem NOD32. http://www.nod32.cz _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
On Thu, Jun 21, 2007 at 01:01:40AM +0200, Artur Linhart - Linux communication wrote:> Hello, > > Is it impossible just to create new logical volume of the same size > with lvcreate and simply copy with dd all bytes from the old LV to the new > one and only modify the configuration file to read from the new physical > device? (or to create the modifiable snapshot logical volume) I think this > could work - the partition itself should know nothing about the physical > location where and how it really runs... Or am I wrong? > > With regards, > > Archie >That''s the brute force method, which is what I am doing now. But it takes too long, and you needlessly copy all the blanks in the file system to the new location. Also, you need the ability to resize the partition, so that''s not a solution. For instance, I want to clone a 2GB windows into a 4GB lvm. How do I go about it? Thanks for the response. _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Artur Linhart - Linux communication
2007-Jun-21 10:37 UTC
[Xen-users] RE: Cloning a Windows VM
Hello, I think, this could be possible = If Zou copz ěGB "virtual disk" to 4 GB, then if You start windows, it should be reported just as a larger physical disk and You can A. either create a new partition and use it: 1. directly a, as a new partition mounted as some directory within NTFS b, as a new partition with the "brand new" "disk letter" or 2. indirectly - in the case You would use Windows dynamic disk system, You can just extend the Windows partition by the new partition (something a little bit similar to PV concept in LVM under Linux) B. or just extend the ntfs partition - this can be done 1. by some linux tool - as far as I remember I reduced the size of the ntfs partition by gparted coming with ubuntu - so the extension should be also possible, or 2. I have heard if You in cfdisk or other similar tool delete and recreate the partition starting from the same position, the data will be not deleted and the partition will contain the original file system... After You then boot into windows, There will be started scandisk because the size remembered on the partition by windows does not correspond with the new real partition size, but this should be no problem. (Only in the case You already use windows dynamic disks I am not sure if it would be possible) I personally tested only the waz with the resize of ntfs through gparted, but I can imagine all the other ways I have heard about can do a good and fast job. With regards Archie -----Original Message----- From: Ligesh [mailto:myself@ligesh.com] Sent: Thursday, June 21, 2007 12:22 PM To: Artur Linhart - Linux communication Cc: ''Xen Users'' Subject: Re: Cloning a Windows VM On Thu, Jun 21, 2007 at 01:01:40AM +0200, Artur Linhart - Linux communication wrote:> Hello, > > Is it impossible just to create new logical volume of the same size > with lvcreate and simply copy with dd all bytes from the old LV to the new > one and only modify the configuration file to read from the new physical > device? (or to create the modifiable snapshot logical volume) I think this > could work - the partition itself should know nothing about the physical > location where and how it really runs... Or am I wrong? > > With regards, > > Archie >That''s the brute force method, which is what I am doing now. But it takes too long, and you needlessly copy all the blanks in the file system to the new location. Also, you need the ability to resize the partition, so that''s not a solution. For instance, I want to clone a 2GB windows into a 4GB lvm. How do I go about it? Thanks for the response. __________ Informace od NOD32 2342 (20070621) __________ Tato zprava byla proverena antivirovym systemem NOD32. http://www.nod32.cz _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Hi, Ligesh a écrit :> On Thu, Jun 21, 2007 at 01:01:40AM +0200, Artur Linhart - Linux communication wrote: > > That''s the brute force method, which is what I am doing now. But it takes too long, and you needlessly copy all the blanks in the file system to the new location. Also, you need the ability to resize the partition, so that''s not a solution. For instance, I want to clone a 2GB windows into a 4GB lvm. How do I go about it? >Sorry if I repeat myself, but clonezilla just do all that ! * It only take care of _used_ space * you can edit partition table before restoring, thus allowing growing or shrinking. My 2 cts Bests JT _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
On Thu, Jun 21, 2007 at 03:51:57PM +0530, Ligesh wrote:> On Thu, Jun 21, 2007 at 01:01:40AM +0200, Artur Linhart - Linux communication wrote: > > Is it impossible just to create new logical volume of the same size > > with lvcreate and simply copy with dd all bytes from the old LV to the new > > one and only modify the configuration file to read from the new physical > > device? (or to create the modifiable snapshot logical volume) I think this > > could work - the partition itself should know nothing about the physical > > location where and how it really runs... Or am I wrong? > > > > That''s the brute force method, which is what I am doing now. But it takes too long,I would also do this complete copy, but create a big file with zeros inside the VM bevore taking the backup. If you are not using some ntfs-encryption then a gzip -3 </dev/vg/lv_win >backup.gz will give you a not-so-large backup. Christian _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users