Version 2.02.89 -
==================================
+ Replace :space: with [\t ] for awk in vgimportclone (not widely supported).
Begin using 64-bit status field flags.
Detect sscanf recovering_region input error in cmirrord pull_state().
Fix error path bitmap leak in cmirrord import_checkpoint().
LVMCONF=${TMP_LVM_SYSTEM_DIR}/lvm.conf
+# FIXME convert to cmdline override
"$LVM" dumpconfig ${LVM_OPTS} | \
"$AWK" -v DEV=${TMP_LVM_SYSTEM_DIR} -v CACHE=${TMP_LVM_SYSTEM_DIR}/.cache \
-v CACHE_DIR=${TMP_LVM_SYSTEM_DIR}/cache \
- '/^[[:space:]]*filter[[:space:]]*=/{print ENVIRON["FILTER"];next} \
- /^[[:space:]]*scan[[:space:]]*=/{print "scan = [ \"" DEV "\" ]";next} \
- /^[[:space:]]*cache[[:space:]]*=/{print "cache = \"" CACHE "\"";next} \
- /^[[:space:]]*cache_dir[[:space:]]*=/{print "cache_dir = \"" CACHE_DIR "\"";next} \
+ '/^[ \t]*filter[ \t]*=/{print ENVIRON["FILTER"];next} \
+ /^[ \t]*scan[ \t]*=/{print "scan = [ \"" DEV "\" ]";next} \
+ /^[ \t]*cache[ \t]*=/{print "cache = \"" CACHE "\"";next} \
+ /^[ \t]*cache_dir[ \t]*=/{print "cache_dir = \"" CACHE_DIR "\"";next} \
{print $0}' > ${LVMCONF}
checkvalue $? "Failed to generate ${LVMCONF}"
# output VG info so each line looks like: name:exported?:disk1,disk2,...
VGINFO=`echo "${PVINFO}" | \
- "$AWK" -F : '{{sub(/^[[:space:]]*/,"")} \
+ "$AWK" -F : '{{sub(/^[ \t]*/,"")} \
{sub(/unknown device/,"unknown_device")} \
{vg[$2]=$1","vg[$2]} if($3 ~ /^..x/){x[$2]="x"}} \
END{for(k in vg){printf("%s:%s:%s\n", k, x[k], vg[k])}}'`
-# Copyright (C) 2010 Red Hat, Inc. All rights reserved.
+# Copyright (C) 2010-2011 Red Hat, Inc. All rights reserved.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions
aux prepare_devs 2
-pvcreate $dev1 $dev2
-vgcreate $vg1 $dev1
+vgcreate -c n --metadatasize 128k $vg1 $dev1
lvcreate -l100%FREE -n $lv1 $vg1
# Clone the LUN
-dd if=$dev1 of=$dev2
+dd if=$dev1 of=$dev2 bs=256K count=1
# Verify pvs works on each device to give us vgname
-pvs --noheadings -o vg_name $dev1 1>err
-grep $vg1 err
-pvs --noheadings -o vg_name $dev2 1>err
-grep $vg1 err
+check pv_field $dev1 vg_name $vg1
+check pv_field $dev2 vg_name $vg1
# Import the cloned PV to a new VG
-# FIXME: this fails on lenny buildslave, I think we need proper wrapper
-# vgimportclone --basevgname $vg2 $dev2
+vgimportclone --basevgname $vg2 $dev2
# Verify we can activate / deactivate the LV from both VGs
-# lvchange -ay $vg1/$lv1
-# lvchange -ay $vg2/$lv1
-# vgchange -an $vg1
-# vgchange -an $vg2
+lvchange -ay $vg1/$lv1 $vg2/$lv1
+vgchange -an $vg1 $vg2