Changeset 3559 for branches


Ignore:
Timestamp:
Apr 11, 2016, 12:45:32 PM (3 years ago)
Author:
bruno
Message:
  • Fix #792 by forcing fixed values for LE if percentage calcultaed for it is 0
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.2/mindi/analyze-my-lvm

    r3499 r3559  
    9494    $LVMCMD vgdisplay $vgname | cat > $fname2
    9595    totalLE=`GetValueFromField $fname2 "Total PE"`
    96     allocation=`perl -e '$per='$currentLE'*100/'$totalLE' ; print int($per+0.5)."%VG";'`
     96    ratio=`perl -e '$per='$currentLE'*100/'$totalLE' ; print int($per)'`
     97    if [ $ratio -eq 0 ]; then
     98        # In that case, restoration will fail with 0% so use value
     99        output="$output -l $currentLE"
     100    else
     101        allocation=`perl -e 'print int('$ratio')."%VG"'`
     102        output="$output -l $allocation"
     103    fi
    97104    readahead=`GetValueFromField $fname "Read ahead sectors"`
    98105    rm -f $fname $fname2
    99106    [ "$stripes" ]    && output="$output -i $stripes"
    100107    [ "$stripesize" ] && output="$output -I $stripesize"
    101     [ "$allocation" ] && output="$output -l $allocation"
    102108    [ "$readahead" ]  && output="$output -r $readahead"
    103109    echo "$output"
Note: See TracChangeset for help on using the changeset viewer.