Changeset 2546 in MondoRescue for branches/2.2.10/mindi/analyze-my-lvm


Ignore:
Timestamp:
Jan 21, 2010, 8:50:00 PM (14 years ago)
Author:
Bruno Cornec
Message:

svn merge -r 2523:2545 /mondorescue/branches/2.2.9

  • Adds the --rescue flag to ntfsclone (Andree Leidenfrost andree_at_debian.org)
  • Fix 2 typos in the HOWTO (reported by Bram Mertens bram-mertens_at_linux.be)
  • Patch from Rogério Brito rbrito_at_ime.usp.br which fixes errors in man pages format
  • Fix syntax issue in analyze-my-lvm
  • Better doc for pre and post
  • Finally the function ListLvmDrivesAndPartitions is used, as it creates info parsed by mindi !! So reverting back to filter excluded devices in it
  • Better exclusion of the LVs from the mountlist at restore time if excludedevs used
  • Exclude LVs whose VGs are excluded now in analyze-my-lvm
  • First attempt to support device exclusion at restore time through a new boot param excludedevs
  • Fix a bug preventing execution of the pre script in init
  • LVM exclusion based on devices was flawed as the function targeted was not really useful. That script shold be fully rewritten to have a data structure contaiing what is needed. Anyway the current patch should allow to have some improvements
  • Do not report Duplicate mount point when lvm is used
  • each device of the EXCLUDE_DEVS list is now used correctly and partitions found on this device are excluded
  • Fix the way the dsf is declared in the linked list to have it work
  • Fix #383 by using pvdisplay instead of relying on 8e as partition type
  • Try to fix #384 by always excluding the dfs per users wish
  • Also use the exclude dev feature in case of multipath and exclude resulting /dev/mapper/mpath type of files
  • Fix #381 by postfixing spaces at the end of the strings to be cheked in strstr
File:
1 edited

Legend:

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

    r2428 r2546  
    5151        fi
    5252    fi
    53     echo "# $LVMCMD lvcreate$params -n $logical_volume $volume_group"
     53    # Do not process LV whose VG are excluded
     54    if [ -f $MINDI_TMP/excludedvgs ]; then
     55        if [ "`grep $volume_group $MINDI_TMP/excludedvgs`" = "" ]; then
     56            echo "# $LVMCMD lvcreate$params -n $logical_volume $volume_group"
     57        fi
     58    fi
     59    rm -f $MINDI_TMP/excludedvgs
    5460}
    5561
     
    131137    fi
    132138
     139    rm -f $MINDI_TMP/excludedvgs
     140    if [ "$EXCLUDE_DEVS" ] ; then
     141        for ed in $EXCLUDE_DEVS ; do
     142            if  [ "`echo " $list_of_devices" | grep " $ed"`" != "" ]; then
     143                echo $current_VG >> $MINDI_TMP/excludedvgs
     144                return
     145            fi
     146        done
     147    fi
    133148    echo "# $LVMCMD vgcreate $current_VG$VG_params $list_of_devices"
    134149    echo "# $LVMCMD vgchange -a y $current_VG"
     
    143158        pvscan 2> /dev/null | grep '"' | cut -d'"' -f2  >  $MINDI_TMP/pv.tmp
    144159    fi
     160
     161    rm -f $MINDI_TMP/pv.tmp2
     162    for d in `cat $MINDI_TMP/pv.tmp`; do
     163        # Skip devices excluded, coming from mondoarchive
     164        skip=0
     165        if [ "$EXCLUDE_DEVS" ] ; then
     166            for ed in $EXCLUDE_DEVS ; do
     167                if  [ "`echo " $d " | grep " $ed"`" != "" ]; then
     168                    skip=1
     169                    continue
     170                fi
     171            done
     172        fi
     173        if [ $skip -eq 1 ]; then
     174            continue
     175        fi
     176        echo $d >> $MINDI_TMP/pv.tmp2
     177    done
     178
    145179    if [ -f /etc/multipath.conf ]; then
    146180        # If multipath check which type of devidec are given, mpath prefered
    147         for d in `cat  $MINDI_TMP/pv.tmp`; do
     181        for d in `cat $MINDI_TMP/pv.tmp2`; do
     182            skip=0
     183            if [ "$EXCLUDE_DEVS" ] ; then
     184                for ed in $EXCLUDE_DEVS ; do
     185                    if  [ "`echo " $d " | grep " $ed"`" != "" ]; then
     186                        skip=1
     187                        continue
     188                    fi
     189                done
     190            fi
     191            if [ $skip -eq 1 ]; then
     192                continue
     193            fi
    148194            GiveMapperOfdm $d
    149195        done
    150196    else
    151         cat $MINDI_TMP/pv.tmp
    152     fi
    153     rm -f $MINDI_TMP/pv.tmp
     197        cat $MINDI_TMP/pv.tmp2
     198    fi
     199    rm -f $MINDI_TMP/pv.tmp $MINDI_TMP/pv.tmp2
    154200}
    155201
     
    177223
    178224ListLvmDrivesAndPartitions() {
     225    # We get partitions in this loop not devices
    179226    for d in `$LVMCMD vgdisplay -v 2> /dev/null | grep "PV Name" | sed 's/(#)//' | awk '{print $3}'`; do
    180         # Skip devices excluded, coming from mondoarchive
    181         if [ "$EXCLUDE_DEVS" ] && [ "`echo " $EXCLUDE_DEVS " | grep " $d "`" ]; then
    182             continue
    183         fi
    184         # If multipath check which type of devides are given, mpath prefered
     227        # If multipath check which type of devices are given, mpath prefered
    185228        if [ -f /etc/multipath.conf ]; then
    186             GiveMapperOfdm $d
     229            i=`GiveMapperOfdm $d`
     230            rep=$i
    187231        else
    188             echo $d
    189         fi
     232            rep=$d
     233        fi
     234        skip=0
     235        if [ "$EXCLUDE_DEVS" ] ; then
     236            for ed in $EXCLUDE_DEVS ; do
     237                if  [ "`echo " $rep " | grep " $ed"`" != "" ]; then
     238                    skip=1
     239                    continue
     240                fi
     241            done
     242        fi
     243        if [ $skip -eq 1 ]; then
     244            continue
     245        fi
     246        echo $rep
    190247    done
    191248}
Note: See TracChangeset for help on using the changeset viewer.