2017-07-02 22:38:32 +03:00
#!/usr/bin/env bash
2018-03-21 13:21:38 +03:00
# Copyright (C) 2018 Red Hat, Inc. All rights reserved.
2014-02-20 02:30:49 +04: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 13:49:46 +03:00
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
2014-02-20 02:30:49 +04:00
# Demonstrate problem when upconverting and cutting leg in clvmd
2018-05-24 17:49:48 +03:00
2016-02-23 01:13:42 +03:00
2014-06-06 19:40:04 +04:00
. lib/inittest
2014-02-20 02:30:49 +04:00
2018-03-21 13:21:38 +03:00
aux prepare_pvs 3 100
2017-07-06 20:41:25 +03:00
get_devs
2014-02-20 02:30:49 +04:00
2018-05-24 17:49:48 +03:00
vgcreate $SHARED -s 64k " $vg " " ${ DEVICES [@] } "
2014-02-20 02:30:49 +04:00
2018-03-21 13:21:38 +03:00
# Use zero devices for big mirror legs
2023-02-09 18:05:40 +03:00
aux zero_dev " $dev2 " " $( get first_extent_sector " $dev2 " ) : "
aux zero_dev " $dev3 " " $( get first_extent_sector " $dev3 " ) : "
2014-02-20 02:30:49 +04:00
2018-03-21 13:21:38 +03:00
lvcreate -aey -L90 --type mirror --corelog --regionsize 16k -m1 -n $lv1 $vg " $dev1 " " $dev2 "
2014-02-20 02:30:49 +04:00
lvconvert -m+1 -b $vg /$lv1 " $dev3 "
2018-03-21 13:21:38 +03:00
# We want here ongoing conversion
2015-03-11 17:42:44 +03:00
2018-03-21 13:21:38 +03: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-20 02:30:49 +04:00
vgremove -f $vg