[linux-lvm] Copying a raw disk image to LVM2

Digimer lists at alteeve.ca
Sat Jul 9 17:00:12 UTC 2016


On 08/07/16 11:52 AM, Brian McCullough wrote:
> 
> I have been hunting for some time over the past couple of days, and find
> several documentss that talk about converting from an LVM2 volume to a
> raw disk image for Xen, but nothing about the reverse.
> 
> I have a VHD disk file that I would like to put on to an LVM2 volume,
> like my other DomU guests.
> 
> I can see using dd, but am concerned about overwriting the LVM2 header.
> 
> 
> Does anybody have any suggestions?

I've done this with KVM before just fine. The LV metadata won't be
overwritten when you write to the actual LV. So this would work fine;

dd if=/path/to/image.raw of=/dev/vg0/lv_foo bs=4M; sync

Then just change your server's definition to point at the LV instead of
the raw file and voila.

-- 
Digimer
Papers and Projects: https://alteeve.ca/w/
What if the cure for cancer is trapped in the mind of a person without
access to education?




More information about the linux-lvm mailing list