From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mimecast-mx02.redhat.com (mimecast04.extmail.prod.ext.rdu2.redhat.com [10.11.55.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9C8F730B84 for ; Mon, 7 Sep 2020 16:34:25 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D6179101AA40 for ; Mon, 7 Sep 2020 16:34:25 +0000 (UTC) From: =?utf-8?Q?Tomas_Dalebj=C3=B6rk?= Mime-Version: 1.0 (1.0) Date: Mon, 7 Sep 2020 18:34:15 +0200 Message-Id: References: In-Reply-To: Content-Transfer-Encoding: 8bit Subject: Re: [linux-lvm] exposing snapshot block device Reply-To: LVM general discussion and development List-Id: LVM general discussion and development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , List-Id: Content-Type: text/plain; charset="utf-8" To: Zdenek Kabelac Cc: LVM general discussion and development thanks for feedback so if I understand this correctly # fallocate -l 100M /tmp/pv1 # fallocate -l 100M /tmp/pv2 # fallocate -l 100M /tmp/pv3 # losetup —find —show /tmp/pv1 # losetup —find —show /tmp/pv2 # losetup —find —show /tmp/pv3 # vgcreate vg0 /dev/loop0 # lvcreate -n lv0 -l 1 vg0 # vgextend vg0 /dev/loop1 # lvcreate -s -l 1 -n lvsnap /dev/loop1 # vgchange -a n vg0 # lvconvert —splitsnapshot vg0/lvsnap # vgreduce vg0 /dev/loop1 # vgcreate vg1 /dev/loop2 # lvcreate -n lv0 -l 1 vg1 # vgextend vg1 /dev/loop1 # lvconvert -s vg1/lvsnap vg1/lv0 not sure if the steps are correct? regards Tomas Sent from my iPhone > On 7 Sep 2020, at 16:17, Zdenek Kabelac wrote: > > Dne 07. 09. 20 v 16:14 Dalebjörk, Tomas napsal(a): >> Hi Mikulas, >> Thanks for the replies >> I am confused now with the last message? >> LVM doesn't support taking existing cow device and attaching it to an existing volume? >> Isn't that what "lvconvert --splitsnapshot" & "lvconvert -s" is ment to be doing? >> lets say that I create the snapshot on a different device using these steps: >> root@src# lvcreate -s -L 10GB -n lvsnap vg/lv /dev/sdh >> root@src# lvconvert ---splitsnapshot vg/lvsnap >> root@src# echo "I now move /dev/sdb to another server" >> root@tgt# lvconvert -s newvg/newlv vg/lvsnap > > Hi > > This is only supported as long as you stay within VG. > So newlv & lvsnap must be in a single VG. > > Note - you can 'vgreduce' PV from VG1 and vgextend to VG2. > But it always work on whole PV base - you can't mix > LV between VGs. > > Zdenek >