Hi, I want to switch (some of) my domUs from file based storage to a LVM based backend - but without losing my domUs (some Linuxes, some Windowses) Is that possible, and if, how? Thanks, Rainer _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
On Tue, Mar 11, 2008 at 11:22:47AM +0100, Rainer Sokoll wrote: (Replying to myself)> I want to switch (some of) my domUs from file based storage to a LVM > based backend - but without losing my domUs (some Linuxes, some > Windowses) > Is that possible, and if, how?That should work by using dd, shouldn''t it? Rainer _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
On Tue, 2008-03-11 at 11:41 +0100, Rainer Sokoll wrote:> On Tue, Mar 11, 2008 at 11:22:47AM +0100, Rainer Sokoll wrote: > > I want to switch (some of) my domUs from file based storage to a LVM > > based backend - but without losing my domUs (some Linuxes, some > > Windowses) > > Is that possible, and if, how? > > That should work by using dd, shouldn''t it? yup. Assuming one device: shutdown guest dd if=/home/doms/mydom.img of=/dev/vgname/lvname bs=10M change xen config to point device to phy:/dev/vgname/lvname boot back up enjoy performance improvement. John. -- http://www.brightbox.co.uk - UK Ruby on Rails hosting _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Does it really make that much of a difference to performance ? If you create the LV greater than the size of the file, once you have dd it across, can you extend the root size ? all will it autodetect the new size ? Regards, -- --[ UxBoD ]-- // PGP Key: "curl -s http://www.splatnix.net/uxbod.asc | gpg --import" // Fingerprint: F57A 0CBD DD19 79E9 1FCC A612 CB36 D89D 2C5A 3A84 // Keyserver: www.keyserver.net Key-ID: 0x2C5A3A84 // Phone: +44 845 869 2749 SIP Phone: uxbod@sip.splatnix.net ----- "John Leach" <john@johnleach.co.uk> wrote:> On Tue, 2008-03-11 at 11:41 +0100, Rainer Sokoll wrote:-- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
On Tue, Mar 11, 2008 at 02:46:04PM +0000, --[ UxBoD ]-- wrote:> Does it really make that much of a difference to performance ?Hopefully it will. I have one domU running Windows XP. If I copy lots of data into that domU, it slows down dramatically, and in dom0 I see approx. 50% iowait. So I hope that switching to LVM will result in a speed bump. Rainer _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
On Tue, 2008-03-11 at 14:46 +0000, --[ UxBoD ]-- wrote:> Does it really make that much of a difference to performance ?In my experience yes, though I don''t have any figures to hand. You''ll see less cpu usage in dom0 (though Rainers problem might be due to the qemu layer used for windows). A good boost comes from not using sparse files too, although a different issue there is no temptation to do so with an LV :)> If you create the LV greater than the size of the file, once you have > dd it across, can you extend the root size ? all will it autodetect > the new size ?create a larger LV, run the dd, then use resize2fs (assuming you''re using ext2/3) to extend the filesystem to the full LV size. You can do this at any time. shutdown guest, extend LV, resize2fs, boot guest back up (though lvresize has the --resizefs option too which just runs resize2fs for you i think). John. -- http://www.brightbox.co.uk - UK Ruby on Rails hosting _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
>> If you create the LV greater than the size of the file, once you have >> dd it across, can you extend the root size ? all will it autodetect >> the new size ? >> > > create a larger LV, run the dd, then use resize2fs (assuming you''re > using ext2/3) to extend the filesystem to the full LV size. > > You can do this at any time. shutdown guest, extend LV, resize2fs, boot > guest back up (though lvresize has the --resizefs option too which just > runs resize2fs for you i think). >This works great if your filesystem is directly on the (raw) LV. However, if you''ve put a partition table on the LV, it''s not as easy. I guess you have to edit the partition table to tell it the new size of the ''disk'' (LV), and then find some way to extend your partitions (maybe parted?). I tried to do this sometime back and experienced some weirdness with the cylinders/heads/sectors not being detected correctly (fancy that!), and never got the disk geometry entered correctly. Parted didn''t like the resized LV, either, as I remember. Might be that the easiest way to deal with this is from within a domU. Pass the LV to the domU as a second disk (xvdb), and partition the LV from within the domU. Then it''s easy to use dd from within the domU (though you may be dding a running fs), or shut down the domU and use kpartx from the dom0 and dd between the mapped devices. You can use resize2fs on the newly dded device. Don''t forget to kpartx -d! John _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
On Tue, Mar 11, 2008 at 3:22 AM, Rainer Sokoll <rainer@sokoll.com> wrote:> Hi, > > I want to switch (some of) my domUs from file based storage to a LVM > based backend - but without losing my domUs (some Linuxes, some > Windowses) > Is that possible, and if, how?Check out qemu-img from the qemu package. It can convert between raw, qcow2, vmdk, etc.. So you can do stuff like convert vmware images to raw on LVM for Xen. lvcreate -n foobar-disk0 -L 5G vgroot qemu-image convert /path/to/loopfile.img -O raw /dev/vgroot/foobar-disk0 Enjoy, -Al> Thanks, > Rainer > > _______________________________________________ > 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