From: Greg Price Date: Wed, 25 Mar 2009 03:58:19 +0000 (-0400) Subject: pv-fixup: more metadata, align PEs, and tweaks X-Git-Url: http://xvm.mit.edu/gitweb/invirt/scripts/pv-fixup.git/commitdiff_plain/97d56e5f05cdc42d9ac1e8a190a6aa9c18a769a5?hp=ec46c89878c5eec920bf681ede8bc9480caca240 pv-fixup: more metadata, align PEs, and tweaks svn path=/trunk/scripts/pv-fixup/; revision=2272 --- diff --git a/pv-fixup b/pv-fixup index abcb494..d5c0830 100644 --- a/pv-fixup +++ b/pv-fixup @@ -8,7 +8,7 @@ TMPDM=tmpfoo TMPDEV=/dev/mapper/$TMPDM TMPDM2=tmpbar TMPDEV2=/dev/mapper/$TMPDM2 -METADATASIZE=3.5m +METADATASIZE=8128k # - pvresize the old PV to half the space pvresize --setphysicalvolumesize=${HALFSIZETiB}t $DISK @@ -92,18 +92,18 @@ done # - 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, # with --setphysicalvolumesize # and with --metadatasize (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