[linux-lvm] convert LV to physical device _in_place_?
Zdenek Kabelac
zkabelac at redhat.com
Thu Jul 13 15:25:10 UTC 2017
Dne 13.7.2017 v 15:25 Matthias Leopold napsal(a):
> hi,
>
> i'm fiddling around with LVM backed KVM raw disks, that i want to use
> _directly_ in oVirt virtualization (as "Direct LUN"). i would like to avoid
> "importing", dd, etc. if possible. in the KVM origin system exists a mapping
> of one iSCSI whole device (no partitions) to one PV to one VG to one LV per
> KVM disk. i can now present these iSCSI devices to the oVirt hosts, where i
> can only use them as "Direct LUN" without the LVM layer (i guess). so all i
> would need is to remove the LVM metadata from the iSCSI device preserving the
> "content" of the LV. pvremove seems to be too "intrusive" for this... i know
> this sounds rather naive and i didn't find any recipes for it. everybody talks
> about dd to a new device, which of course works (i tried it), but is exactly
> what i want to avoid when migrating very large disks (TB). i hope someone
> understands my concern and maybe has a solution
>
Hi
Yep, it really sounds a bit naive :)
PV has 'header' so the real 'data' are shifted by PV header+lvm2 metadata.
and also LV does not need to be sequential.
However if you have been having a single 'segment' LV and and you calculate
proper skipping offset (typically 1MB) you can try to use such device directly
without lvm2 with a loop device mapping - see losetup --offset option - but
you would need to use this everytime you want to access such storage - so
there is not a single magic 'flip' which would make an LV to appear like
regular device.
Regards
Zdenek
More information about the linux-lvm
mailing list