[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-users] How to migrate image files in lvm

Le lundi 25 mars 2013 Ã 17:19 +0100, Thore a Ãcrit :
> Hello,
> I have problem with my xen installation on my wheezy server.
> I haven't really an idea hown to.
> So I'm using xen image files.
> Now one VPS reached the limit of free space and killed more or less itself.
> I needet some hours to find out.
> Now my Idea to solve is to migrate the files in an lvm version.
> I never used it before, but I have no problem to configure.
> Now I ask how to migrate the files and how to install it in a lvm partition.
> Anyone here who could help?
> Regards
> Thore


The process to copy your image to a LVM partition is not too
complicated :

If your image is in "raw" format go to Step 2.

Step 1 : convert image in "raw" format.

qemu-img convert -f vmdk original_image.vmdk -O raw xen_compatible.img

VMDK or another format like QCOW, QCOW2 ...

Step 2 : create your LVM partition
Make it bigger than "xen_compatible.img" !

Step 3 : copy the data
"dd" is your friend

dd if=xen_compatible.img of=/dev/your_lvm_partition bs=32k

Step 4 : resize the FS

Mount the partition on another machine (could be another VM) and
"resize" the filesystem to "fill" the LVM partition. (It is not possible
to do a "live" filesystem resize ).

Step 5 : all should be OK
link the new filesystem to your VM instead of the "old" image file and
try to start your VM

The process is safe as your original image is not destroyed, you can
wait a little before scratching it.

I never use image files, LVM is easier to adapt to the needs.



Xen-users mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.