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

Re: [Xen-users] Converting from raw disk image to LVM2



Hi,

On 07/08/16 16:22, Brian McCullough wrote:
> I have been hunting for some time today, and find several documents that
> talk about converting from an LVM2 volume to a raw disk image for Xen,
> but nothing about the reverse.

Well, a vanilla" LVM2 logical volume is no different from a raw disk
image, except that the first is managed by lvm, while the second one is
typically stored as a file on a file system or a raw partition on a disk.

> I have a VHD disk file that I would like to put on to an LVM2 volume,
> like my other DomU guests.

Well, as the VHD has some headers and stuff, I'd recommend to convert it
to a raw image first by doing something like:

$ qemu-img convert -f vpc -O raw original.vhd output.raw


> I can see using dd, but am concerned about overwriting the LVM2 header.
A logical volume does not need special treatment compared to a "real"
partition or block device. LVM2 meta data are stored somewhere else in
the volume group, as far as I know. There may be better ways to do this,
but I used dd quiet a few times to move stuff from and to LVM2 logical
volumes.
In my opinion, it is okay to think of a "partition" when working with
logical volumes. LVM2 is nothing more than an abstraction layer between
the file system (or even another partition table) and one or more
(mostly physical) block devices.


I hope that it gives a hint into the right direction, but remember to
keep backups before you lose any crucial data.

Cheers
CRT

_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxx
https://lists.xen.org/xen-users

 


Rackspace

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