Sync usage with man page.
[netbsd-mini2440.git] / external / gpl2 / lvm2 / dist / test / t-unlost-pv.sh
blob7a120fbf413f72eb0130ca2df8767f5e417d67ab
1 #!/bin/sh
2 # Copyright (C) 2008 Red Hat, Inc. All rights reserved.
4 # This copyrighted material is made available to anyone wishing to use,
5 # modify, copy, or redistribute it subject to the terms and conditions
6 # of the GNU General Public License v.2.
8 # You should have received a copy of the GNU General Public License
9 # along with this program; if not, write to the Free Software Foundation,
10 # Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
12 . ./test-utils.sh
14 aux prepare_vg 3
16 lvcreate -m 1 -l 1 -n mirror $vg
17 lvchange -a n $vg/mirror
19 check() {
20 vgscan 2>&1 | tee vgscan.out
21 grep "Inconsistent metadata found for VG $vg" vgscan.out
22 vgscan 2>&1 | tee vgscan.out
23 not grep "Inconsistent metadata found for VG $vg" vgscan.out
26 # try orphaning a missing PV (bz45867)
27 disable_dev $dev1
28 vgreduce --removemissing --force $vg
29 enable_dev $dev1
30 check
32 # try to just change metadata; we expect the new version (with MISSING_PV set
33 # on the reappeared volume) to be written out to the previously missing PV
34 vgextend $vg $dev1
35 disable_dev $dev1
36 lvremove $vg/mirror
37 enable_dev $dev1
38 check