WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-users

[Xen-users] Re: migrate file-based vm to lvm?

To: s0nspark <s0nspark@xxxxxxxxx>
Subject: [Xen-users] Re: migrate file-based vm to lvm?
From: Ferenc Wagner <wferi@xxxxxxx>
Date: Wed, 07 Jan 2009 17:46:27 +0100
Cc: xen-users@xxxxxxxxxxxxxxxxxxx
Delivery-date: Wed, 07 Jan 2009 08:47:09 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <21334456.post@xxxxxxxxxxxxxxx> (s0nspark@xxxxxxxxx's message of "Wed, 7 Jan 2009 08:09:07 -0800 (PST)")
List-help: <mailto:xen-users-request@lists.xensource.com?subject=help>
List-id: Xen user discussion <xen-users.lists.xensource.com>
List-post: <mailto:xen-users@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=unsubscribe>
References: <21331539.post@xxxxxxxxxxxxxxx> <EBEEB3C8FBD6B0448AEDF986B303BEB60C1BCA93@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> <21334456.post@xxxxxxxxxxxxxxx>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux)
s0nspark <s0nspark@xxxxxxxxx> writes:

> hmm .. I thought of this but I'm not sure how it would work since each image
> file contains 2 partitions, a root partition and a swap partition... I seem
> to recall perhaps some mention of kpartx coming into play... but my memory
> is foggy on the details...

If you dd the file to an LV, that LV will be usable as a whole disk
(xvda) by your domU, exactly like the file was.

If your file isn't sparse, you can create a block device from it by
losetup, then use kpartx on the resulting loop to create separate
block devices for its partitions.  Then you could dd these partition
devices into separate LVs for example, and present those LVs to you
domU as partitions (xvdaN).
-- 
Feri.

_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users