Changeset 2072 in MondoRescue for branches/2.2.8/mindi/analyze-my-lvm


Ignore:
Timestamp:
Dec 5, 2008, 3:32:59 PM (15 years ago)
Author:
Bruno Cornec
Message:
  • Adds multipath support (as exists on RHEL 5.2)
    • analyze-my-lvm/mindi uses the /dev/mapper/mpath... entry and not /dev/dm-... entry which is not automatically created at restore time
    • Lots of mapth dmsetup commands added to deplist
    • Adds required modules to mindi
    • Fix a bug for this in mindi around real devices with /dev/mapper/mpath... names
    • init has a new StartMpath function to start multipath correctly hopefully
    • mondorestore has a new clean_multiconf function which removes /var/lib/multipath/bindings and edits /etc/multipath.conf if needed
File:
1 edited

Legend:

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

    r2044 r2072  
    117117        done
    118118    fi
     119    l=""
     120    if [ -f /etc/multipath.conf ]; then
     121        # If multipath check which type of devidec are given, mpath prefered
     122        for d in $list_of_devices; do
     123            l="$l `GiveMapperOfdm $d`"
     124        done
     125        list_of_devices=$l
     126    fi
     127
    119128    echo "# $LVMCMD vgcreate $current_VG$VG_params $list_of_devices"
    120129    echo "# $LVMCMD vgchange -a y $current_VG"
     
    125134ListAllPhysicalVolumes() {
    126135    if [ $lvmversion = 2 ]; then
    127         $LVMCMD pvscan 2> /dev/null | grep 'PV' | awk '{print $2}'
    128     else
    129         pvscan 2> /dev/null | grep '"' | cut -d'"' -f2
    130     fi
     136        $LVMCMD pvscan 2> /dev/null | grep 'PV' | awk '{print $2}' >  $MINDI_TMP/pv.tmp
     137    else
     138        pvscan 2> /dev/null | grep '"' | cut -d'"' -f2  >  $MINDI_TMP/pv.tmp
     139    fi
     140    if [ -f /etc/multipath.conf ]; then
     141        # If multipath check which type of devidec are given, mpath prefered
     142        for d in `cat  $MINDI_TMP/pv.tmp`; do
     143            GiveMapperOfdm $d
     144        done
     145    else
     146        cat $MINDI_TMP/pv.tmp
     147    fi
     148    rm -f $MINDI_TMP/pv.tmp
    131149}
    132150
     
    136154}
    137155
     156GiveMapperOfdm () {
     157
     158major=`stat -c "%t" $1`
     159minor=`stat -c "%T" $1`
     160
     161for i in `ls /dev/mapper/*`; do
     162    mj=`stat -c "%t" $i`
     163    mn=`stat -c "%T" $i`
     164    if [ "$mj" = "$major" ] && [ "$mn" = "$minor" ]; then
     165        echo "$i"
     166        return
     167    fi
     168done
     169echo $1
     170}
     171
    138172
    139173ListLvmDrivesAndPartitions() {
    140     $LVMCMD vgdisplay -v 2> /dev/null | grep "PV Name" | sed 's/(#)//' | awk '{print $3}'
     174    $LVMCMD vgdisplay -v 2> /dev/null | grep "PV Name" | sed 's/(#)//' | awk '{print $3}' > $MINDI_TMP/vg.tmp
     175    if [ -f /etc/multipath.conf ]; then
     176        # If multipath check which type of devidec are given, mpath prefered
     177        for d in `cat  $MINDI_TMP/vg.tmp`; do
     178            GiveMapperOfdm $d
     179        done
     180    else
     181        cat $MINDI_TMP/vg.tmp
     182    fi
     183    rm -f $MINDI_TMP/vg.tmp
    141184}
    142185
Note: See TracChangeset for help on using the changeset viewer.