[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-users] Converting from raw disk image to LVM2
On 2016-07-11 09:40, Carl Schneider wrote: 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. As far as Xen is concerned, other than having to set up a loop device for a file backed disk image, they are actually identical. Once you have the loop device bound to the file (which the tool-stack does automatically during domain setup 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've only rarely done conversions like this before (I just use raw images on LVM volumes for everything and rarely if ever have to import VM's), but the command above works perfectly fine, and if you use the LVM volume as the output file, you don't even need any extra storage space and can avoid having to write the data twice (once for the conversion, then once for copying to the LVM volume). 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. This is absolutely true, LVM is just another abstraction layer just likea partition table. Just like how a partition table is stored on the disk and not touched by whatever is written to the partitions it delimits, LVM2 metadata is stored in the physical volumes and not touched by anything stored in the logical volumes it describes. The only high level difference is that LVM provides a higher degree of abstraction from the hardware than a traditional partition table. _______________________________________________ Xen-users mailing list Xen-users@xxxxxxxxxxxxx https://lists.xen.org/xen-users
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |