2017-07-02 21:38:32 +02:00
#!/usr/bin/env bash
2018-03-21 11:21:38 +01:00
# Copyright (C) 2018 Red Hat, Inc. All rights reserved.
2014-02-19 23:30:49 +01:00
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions
# of the GNU General Public License v.2.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
2016-01-21 11:49:46 +01:00
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
2014-02-19 23:30:49 +01:00
# Demonstrate problem when upconverting and cutting leg in clvmd
2018-05-24 09:49:48 -05:00
2016-02-22 16:13:42 -06:00
2014-06-06 17:40:04 +02:00
. lib/inittest
2014-02-19 23:30:49 +01:00
2018-03-21 11:21:38 +01:00
aux prepare_pvs 3 100
2017-07-06 19:41:25 +02:00
get_devs
2014-02-19 23:30:49 +01:00
2018-05-24 09:49:48 -05:00
vgcreate $SHARED -s 64k " $vg " " ${ DEVICES [@] } "
2014-02-19 23:30:49 +01:00
2018-03-21 11:21:38 +01:00
# Use zero devices for big mirror legs
aux zero_dev " $dev2 " $( get first_extent_sector " $dev2 " ) :
aux zero_dev " $dev3 " $( get first_extent_sector " $dev3 " ) :
2014-02-19 23:30:49 +01:00
2018-03-21 11:21:38 +01:00
lvcreate -aey -L90 --type mirror --corelog --regionsize 16k -m1 -n $lv1 $vg " $dev1 " " $dev2 "
2014-02-19 23:30:49 +01:00
lvconvert -m+1 -b $vg /$lv1 " $dev3 "
2018-03-21 11:21:38 +01:00
# We want here ongoing conversion
2015-03-11 15:42:44 +01:00
2018-03-21 11:21:38 +01:00
lvs -a -o+seg_pe_ranges $vg
# Now it should be able to drop 2nd. leg
lvconvert -m-1 $vg /$lv1 " $dev2 "
lvs -a $vg
2014-02-19 23:30:49 +01:00
vgremove -f $vg