xref: /dflybsd-src/contrib/lvm2/dist/test/t-unknown-segment.sh (revision 86d7f5d305c6adaa56ff4582ece9859d73106103)
186d7f5d3SJohn Marino#!/bin/sh
286d7f5d3SJohn Marino# Copyright (C) 2009 Red Hat, Inc. All rights reserved.
386d7f5d3SJohn Marino#
486d7f5d3SJohn Marino# This copyrighted material is made available to anyone wishing to use,
586d7f5d3SJohn Marino# modify, copy, or redistribute it subject to the terms and conditions
686d7f5d3SJohn Marino# of the GNU General Public License v.2.
786d7f5d3SJohn Marino#
886d7f5d3SJohn Marino# You should have received a copy of the GNU General Public License
986d7f5d3SJohn Marino# along with this program; if not, write to the Free Software Foundation,
1086d7f5d3SJohn Marino# Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
1186d7f5d3SJohn Marino
1286d7f5d3SJohn Marino. ./test-utils.sh
1386d7f5d3SJohn Marino
1486d7f5d3SJohn Marinoaux prepare_vg 4
1586d7f5d3SJohn Marino
1686d7f5d3SJohn Marinolvcreate -l 1 -n $lv1 $vg
1786d7f5d3SJohn Marinolvcreate -l 2 -m 1 -n $lv2 $vg
1886d7f5d3SJohn Marino
1986d7f5d3SJohn Marinovgcfgbackup -f bak0 $vg
2086d7f5d3SJohn Marinosed -e 's,striped,unstriped,;s,mirror,unmirror,' -i.orig bak0
2186d7f5d3SJohn Marinovgcfgrestore -f bak0 $vg
2286d7f5d3SJohn Marino
2386d7f5d3SJohn Marino# we have on-disk metadata with unknown segments now
2486d7f5d3SJohn Marinonot lvchange -a y $vg/$lv1 # check that activation is refused
2586d7f5d3SJohn Marino
2686d7f5d3SJohn Marinovgcfgbackup -f bak1 $vg
2786d7f5d3SJohn Marinocat bak1
2886d7f5d3SJohn Marinosed -e 's,unstriped,striped,;s,unmirror,mirror,' -i.orig bak1
2986d7f5d3SJohn Marinovgcfgrestore -f bak1 $vg
3086d7f5d3SJohn Marinovgcfgbackup -f bak2 $vg
3186d7f5d3SJohn Marino
3286d7f5d3SJohn Marinoegrep -v 'description|seqno|creation_time|Generated' < bak0.orig > a
3386d7f5d3SJohn Marinoegrep -v 'description|seqno|creation_time|Generated' < bak2 > b
3486d7f5d3SJohn Marinodiff -u a b
35