Index: trunk/scripts/pv-fixup/pv-fixup
===================================================================
--- trunk/scripts/pv-fixup/pv-fixup	(revision 2271)
+++ trunk/scripts/pv-fixup/pv-fixup	(revision 2272)
@@ -9,5 +9,5 @@
 TMPDM2=tmpbar
 TMPDEV2=/dev/mapper/$TMPDM2
-METADATASIZE=3.5m
+METADATASIZE=8128k
 
 #  - pvresize the old PV to half the space
@@ -93,6 +93,7 @@
 
 #  - pvremove the old PV
-vgreduce $VG $DISK
-pvremove $DISK
+LVM_SYSTEM_DIR=lvm vgreduce $VG $DISK
+dmsetup create $TMPDM2 --table "0 $((2 * 1024 * 20)) linear $DISK 0"
+pvremove $TMPDEV2
 
 #  - pvcreate a new PV in the old space,
@@ -100,9 +101,8 @@
 #     and with --metadatasize <huge>    (the point of this exercise)
 shortsize=$(python -c "print $HALFSIZETiB - 0.01")t
-dmsetup create $TMPDM2 --table "0 $((2 * 1024 * 4)) linear $DISK 0"
 pvcreate $TMPDEV2 --setphysicalvolumesize $shortsize --metadatasize $METADATASIZE
 dmsetup remove $TMPDM2
 pvscan
-vgextend $VG $DISK
+LVM_SYSTEM_DIR=lvm vgextend $VG $DISK
 
 #  - pvmove all the LVs back
