[linux-lvm] exposing snapshot block device

Zdenek Kabelac zkabelac at redhat.com
Fri Sep 4 12:37:59 UTC 2020


Dne 04. 09. 20 v 14:09 Tomas Dalebjörk napsal(a):
> hi
> 
> I tried to perform as suggested
> # lvconvert —splitsnapshot vg/lv-snap
> works fine
> # lvconvert -s vg/lv vg/lv-snap
> works fine too
> 
> but...
> if I try to converting cow data directly from the meta device, than it doesn’t 
> work
> eg
> # lvconvert -s vg/lv /dev/mycowdev
> the tool doesn’t like the path
> I tried to place a link in /dev/vg/mycowdev -> /dev/mycowdev

Hi

lvm2 does only support 'objects' within VG without any plan to support 
'external' devices.

So user may not take any 'random' device in a system and use it for
commands like lvconvert.

There is always very strict requirement to place block devices as VG member 
first (pvcreate, vgextend...) and then user can allocate space of this device 
for various LVs.

> conclusion
> even though the cow device is an exact copy of the cow device that I have 
> saved on /dev/mycowdev before the split, it wouldn’t work to use to convert 
> back as a lvm snapshot

COW data needs to be simply stored on an LV for use with lvm2.

You may of course use the 'dmsetup' command directly and arrange your
snapshot setup in the way to combine various kinds of devices - but this
is going completely without any lvm2 command involved - in this case
you have to fully manipulate all devices in your device stack with this
dmsetup command.

Regards

Zdenek




More information about the linux-lvm mailing list