Changeset 3432


Ignore:
Timestamp:
Aug 28, 2015, 2:34:47 AM (3 years ago)
Author:
bruno
Message:
  • Change analyze-my-lvm in order to generate percentage of Extents of a VG to use to create the LV instead of a fixed size. Should improve bugs when creating LVM on a disk of different size greatly.
Location:
branches/3.2
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/3.2/MondoRescue/lib/MondoRescue/Disk.pm

    r3369 r3432  
    6464return ($type);
    6565}
     66
     67
  • branches/3.2/MondoRescue/lib/MondoRescue/LVM.pm

    r3312 r3432  
    160160
    161161The LVM hash is indexed by VGs, provided by the vg_name attribute of the pvs command
     162
    162163vg_name              - Name of the volume group linked to this PV
    163164
     
    169170
    170171The structure contains an array of PVs called pvs and starting at 1, containing the name of the PV as provided by the pv_name attribute of the pvs command
     172
    171173pv_name              - Name of the physical volume PV
    172174
  • branches/3.2/mindi/analyze-my-lvm

    r3312 r3432  
    8282    local device stripes stripesize device fname allocation output readahead
    8383    fname=$MINDI_TMP/PLF.$$.txt
     84    fname2=$MINDI_TMP/PLF2.$$.txt
    8485    device=$1
    8586    output=""
     
    8990    [ "$stripesize" = "m" ] && stripesize=`GetValueFromField $fname "Stripe size (KByte)"`k
    9091    [ "$stripesize" = "k" ] && stripesize=""
    91     allocation=`GetValueFromField $fname "LV Size"`
    92     [ ! "`echo "$allocation" | grep "[k,m,g,t]"`" ] && allocation="$allocation"m
    93     if echo "$allocation" | grep -E '^.*g$' > /dev/null 2> /dev/null ; then
    94         val=`echo "$allocation" | sed s/g//`
    95         allocation=`echo "$val" | awk '{c=$1; printf "%d", c*1024;}'`m
    96     fi
     92    currentLE=`GetValueFromField $fname "Current LE"`
     93    vgname=`GetValueFromField $fname "VG Name"`
     94    $LVMCMD vgdisplay $vgname | cat > $fname2
     95    totalLE=`GetValueFromField $fname2 "Total PE"`
     96    allocation=`perl -e '$per='$currentLE'*100/'$totalLE' ; print int($per+0.5)."%VG";'`
    9797    readahead=`GetValueFromField $fname "Read ahead sectors"`
    98     rm -f $fname
     98    rm -f $fname $fname2
    9999    [ "$stripes" ]    && output="$output -i $stripes"
    100100    [ "$stripesize" ] && output="$output -I $stripesize"
    101     [ "$allocation" ] && output="$output -L $allocation"
     101    [ "$allocation" ] && output="$output -l $allocation"
    102102    [ "$readahead" ]  && output="$output -r $readahead"
    103103    echo "$output"
  • branches/3.2/mindi/mindi

    r3430 r3432  
    144144    if [ _"$2" != _"" ]; then
    145145        grep -Ev "tar: Removing [a-z ]*\`/\'" "$2" >> $LOGFILE
    146     fi
    147     rm -f "$2"
     146        rm -f "$2"
     147    fi
    148148}
    149149
  • branches/3.2/mondo/src/common/libmondo-devices.c

    r3431 r3432  
    10911091
    10921092    if (device_raw[0] != '/' && !strstr(device_raw, ":/")) {
    1093         log_msg(1, "%s needs to have a '/' prefixed - I'll do it",
    1094                 device_raw);
     1093        log_msg(1, "%s needs to have a '/' prefixed - I'll do it", device_raw);
    10951094        mr_asprintf(tmp, "/%s", device_raw);
    10961095    } else {
     
    10991098    log_msg(1, "Is %s mounted?", tmp);
    11001099    if (!strcmp(tmp, "/proc") || !strcmp(tmp, "proc")) {
    1101         log_msg(1,
    1102                 "I don't know how the heck /proc made it into the mountlist. I'll ignore it.");
     1100        log_msg(1, "I don't know how the heck /proc made it into the mountlist. I'll ignore it.");
    11031101        mr_free(tmp);
    11041102        return(FALSE);
     
    11241122    mr_free(device_with_tab);
    11251123    paranoid_pclose(fin);
     1124
    11261125    mr_asprintf(tmp, "%s | grep -E \"^%s\" > /dev/null 2> /dev/null", SWAPLIST_COMMAND, device_with_space);
    11271126    mr_free(device_with_space);
Note: See TracChangeset for help on using the changeset viewer.