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

Марк Коренберг socketpair at gmail.com
Sat Jul 9 17:33:51 UTC 2016


One note: `sync` does not syncs written data, since it affects only
data, written through filesystem. You should use `dd ....
conv=fdatasync` instead.

2016-07-09 22:00 GMT+05:00 Digimer <lists at alteeve.ca>:
> 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?
>
> _______________________________________________
> linux-lvm mailing list
> linux-lvm at redhat.com
> https://www.redhat.com/mailman/listinfo/linux-lvm
> read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/



-- 
Segmentation fault




More information about the linux-lvm mailing list