Hi all. I''ve got a domU that exists in a sparse file image, I''d like to now use this on a physical partition (loopback performance issues). Is there an a easy way to do this ? Thanks Stuart _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Stuart Poulton schrieb:> Hi all. > > I''ve got a domU that exists in a sparse file image, I''d like to now use > this on a physical partition (loopback performance issues). > > Is there an a easy way to do this ? > > Thanks > > Stuart > > > _______________________________________________ > Xen-users mailing list > Xen-users@lists.xensource.com > http://lists.xensource.com/xen-users > >just stop the domu, mount the image and the disk # mount -o loop /foo/bar/myimage /mnt/old # mount /dev/sdx1 /mnt/new and copy all the files # cd /mnt/old # tar c * | tar x -C /mnt/new and change the domu`s config _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Stuart Poulton schrieb:> Hi all. > > I''ve got a domU that exists in a sparse file image, I''d like to now use > this on a physical partition (loopback performance issues). > > Is there an a easy way to do this ? > > Thanks > > Stuart"cp -a" would also work _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
MS wrote:> just stop the domu, mount the image and the disk > # mount -o loop /foo/bar/myimage /mnt/oldIf the image is a virtual disk, you need to skip to the first sector of the partition: losetup /dev/loop0 /foo/bar/myimage sfdisk -l /dev/loop0 # get the start sector of the partition. The first partition on the first sector of the second track. With 63 sectors per track, the offset is 63 * 512 = 32256. # example: losetup -o 32256 /dev/loop1 /dev/loop0 # now mount the first partition of the virtual disk mount /dev/loop1 /mnt/old> # mount /dev/sdx1 /mnt/new > > and copy all the files > # cd /mnt/old > # tar c * | tar x -C /mnt/new >Be carefull with "tar <options> *" as it skips hidden files in the root directory. Better is to use "tar <options> ." Bas. _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Use "dd" to set up the physical partition from the disk image file and change your config to point to the physical device. -----Original Message----- From: xen-users-bounces@lists.xensource.com [mailto:xen-users-bounces@lists.xensource.com] On Behalf Of Stuart Poulton Sent: Sunday, April 06, 2008 11:27 PM To: xen-users@lists.xensource.com Subject: [Xen-users] img file to physical disk Hi all. I''ve got a domU that exists in a sparse file image, I''d like to now use this on a physical partition (loopback performance issues). Is there an a easy way to do this ? Thanks Stuart _______________________________________________ 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
> I''ve got a domU that exists in a sparse file image, I''d like to now use > this on a physical partition (loopback performance issues).You could also try using a tap:aio: disk instead of a file: disk. This avoids some of the bad aspects of file-backed VBDs because it doesn''t use the loopback device. It might be worth checking whether this does what you want before making a larger move. Cheers, Mark> Is there an a easy way to do this ? > > Thanks > > Stuart > > > _______________________________________________ > Xen-users mailing list > Xen-users@lists.xensource.com > http://lists.xensource.com/xen-users-- Push Me Pull You - Distributed SCM tool (http://www.cl.cam.ac.uk/~maw48/pmpu/) _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Hi Bas, i stuck a bit. This is what I tried. tyan:/var/lib/xen # cd images/api/ tyan:/var/lib/xen/images/api # losetup /dev/loop0 disk0 tyan:/var/lib/xen/images/api # sfdisk -l /dev/loop0 Disk /dev/loop0: cannot get geometry Disk /dev/loop0: 1305 cylinders, 255 heads, 63 sectors/track Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0 Device Boot Start End #cyls #blocks Id System /dev/loop0p1 0+ 65 66- 530113+ 82 Linux swap / Solaris /dev/loop0p2 66 1304 1239 9952267+ 83 Linux /dev/loop0p3 0 - 0 0 0 Empty /dev/loop0p4 0 - 0 0 0 Empty now I stuck what to do to mount "loop0p2". This is the partition I want to mount. Thanks for your help Kind regards Chris Bas Mevissen schrieb:> MS wrote: > >> just stop the domu, mount the image and the disk >> # mount -o loop /foo/bar/myimage /mnt/old > > If the image is a virtual disk, you need to skip to the first sector of > the partition: > > losetup /dev/loop0 /foo/bar/myimage > sfdisk -l /dev/loop0 # get the start sector of the partition. > > The first partition on the first sector of the second track. With 63 > sectors per track, the offset is 63 * 512 = 32256. > > # example: > losetup -o 32256 /dev/loop1 /dev/loop0 > # now mount the first partition of the virtual disk > mount /dev/loop1 /mnt/old > >> # mount /dev/sdx1 /mnt/new >> >> and copy all the files >> # cd /mnt/old >> # tar c * | tar x -C /mnt/new >> > > Be carefull with "tar <options> *" as it skips hidden files in the root > directory. Better is to use "tar <options> ." > > Bas. > > > _______________________________________________ > 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