Changeset 2321 for trunk/scripts/pv-fixup/lvmanip
- Timestamp:
- May 2, 2009, 6:53:34 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/scripts/pv-fixup/lvmanip
r2285 r2321 2 2 exit 1 3 3 4 DISK=/dev/mapper/36090a028407d6e2b2589a45cdb9714894 SOURCE=/dev/mapper/36090a028407d6e2b2589a45cdb971489 5 5 6 6 # The name of the LVM archive to get data from … … 12 12 lvmextractint () { 13 13 perl -lne 'print $1 if (/'"$1"' = ([0-9]+)/)' 14 } 15 16 # Extract the first block of an lv to a file named part-$lv 17 getfirstblock () { 18 lvname="$1" 19 offset=$(grep -A16 $'\t'$lvname $ARCHIVE | grep pv0 | cut -f 2 -d ,); 20 if [ -z "$offset" ]; then echo "WARNING: LV not found"; 21 else 22 echo "Extracting $lvname from offset $offset" 23 dd if=$SOURCE of=part-$lvname bs=1M skip=$(( $offset * 8192 + 384 )) bs=512 count=1; 24 fi 14 25 } 15 26 … … 70 81 else 71 82 echo "# Extracting $lvname from offset $offset PEs with length $length PEs" 72 echo dd if=$ DISKof=/dev/xenvg/$lvname \83 echo dd if=$SOURCE of=/dev/xenvg/$lvname \ 73 84 skip=$(( $offset * 64 + 3 )) bs=64K count=$(( $length * 64 )) 74 85 fi … … 90 101 else 91 102 echo "# Extracting $lvname segment 2 from offset $offset PEs with length $length PEs" 92 echo dd if=$ DISKof=/dev/xenvg/$lvname bs=64K \103 echo dd if=$SOURCE of=/dev/xenvg/$lvname bs=64K \ 93 104 skip=$(($offset*64 + 3)) count=$(($length*64)) seek=$(($seek*64)) 94 105 fi
Note: See TracChangeset
for help on using the changeset viewer.