the lvm metadata is stored in the begining of the physical volume, the logical volume is simple block device, so using dd you don't overwrite any lvm header.
2016-07-09 19:33 GMT+02:00 Марк Коренберг <[email protected]>: > 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 <[email protected]>: >> 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 >> [email protected] >> https://www.redhat.com/mailman/listinfo/linux-lvm >> read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/ > > > > -- > Segmentation fault > > _______________________________________________ > linux-lvm mailing list > [email protected] > https://www.redhat.com/mailman/listinfo/linux-lvm > read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/ -- .~. /V\ // \\ /( )\ ^`~'^ _______________________________________________ linux-lvm mailing list [email protected] https://www.redhat.com/mailman/listinfo/linux-lvm read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/
