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


Ignore:
Timestamp:
Feb 2, 2010, 10:40:28 AM (14 years ago)
Author:
Bruno Cornec
Message:

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

  • Improve device exclusion for LVM by adding support for symlinks and mapper systematically at all levels (PV, VG, LV). Shoul

d really provvide the best support possible for LVM exclusion.

  • Now supports also exclusion of LVs directly
  • Improve mindi by handling excluded devices earlier in the loop.
  • Fix LV exclusion when VGs are excluded (the excludedvgs file has to be removed at start and end of analyze-my-lvm not in fu

nctions, as they are called multiple times)

  • Rename some variables exported to avoid accidental conflict (EXCLUDE_DEVS => MINDI_EXCLUDE_DEVS and ADDITIONAL_BOOT_PARAMS

=> MINDI_ADDITIONAL_BOOT_PARAMS)

  • setfattr also needs the -h flag to restore attributes on symlinks, not on the target file (which may not exist BTW). Should solve #388.
  • Using forcemods="mod1 mod2" will now do something and load those modules first
  • Update web page on distributions to download
  • Add support for ums_cypress module in mindi
  • Fix acl backup which was completely wrong.
  • Fix a bug where LV were not created anymore if no exclusion !!
  • In analyze-my-lvm only use pv.tmp2 when it exists to avoid error msgs

-Adds support for links to modules (.ko pointing to .o) such as with VMWare extensions

  • Adds i-want-my-lvm content in mindi log file
  • Adds vmxnet3 driver support to mindi for some VMWare versions
  • Fix a typo in the way device mapper files where excluded
  • use option -h of getfattr to *not* follow symlinks, which breaks RHEL 5.4 as reported in #388. However, getfacl doesn't provide such an option.
  • Adds some logs for filelist creation
  • Remove option -P from getfattr which may also skip symlinks - Attempt to solve #388
  • Exclude rpc_pipefs type of filesystems from find
  • Suppress unused mode_of_file function
File:
1 edited

Legend:

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

    r2546 r2569  
    5151        fi
    5252    fi
     53
     54    # Exclude LVs member of that env var
     55    if [ "$MINDI_EXCLUDE_DEVS" ] ; then
     56        list_of_devices="`mindi --readalllink $LV_full_string`"
     57        l=""
     58        for d in $list_of_devices; do
     59            l="$l `GiveMapperOfdm $d`"
     60        done
     61        list_of_devices="`echo $l | sort -u`"
     62        for ed in $MINDI_EXCLUDE_DEVS ; do
     63            if  [ "`echo " $list_of_devices" | grep " $ed"`" != "" ]; then
     64                echo "Not including device $LV_full_string as it was excluded"
     65                return
     66            fi
     67        done
     68    fi
    5369    # Do not process LV whose VG are excluded
    5470    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
     71        if [ "`grep $volume_group $MINDI_TMP/excludedvgs`" != "" ]; then
     72            echo "Not including LV $logical_volume as VG $volume_group was excluded"
     73            return
     74        fi
     75    fi
     76
     77    echo "# $LVMCMD lvcreate$params -n $logical_volume $volume_group"
    6078}
    6179
     
    130148    l=""
    131149    if [ -f /etc/multipath.conf ]; then
    132         # If multipath check which type of devidec are given, mpath prefered
     150        # If multipath check which type of devide are given, mpath prefered
    133151        for d in $list_of_devices; do
     152            l="$l `mindi --readalllink $d`"
    134153            l="$l `GiveMapperOfdm $d`"
    135154        done
    136         list_of_devices=$l
    137     fi
    138 
    139     rm -f $MINDI_TMP/excludedvgs
    140     if [ "$EXCLUDE_DEVS" ] ; then
    141         for ed in $EXCLUDE_DEVS ; do
     155        list_of_devices="`echo $l | sort -u`"
     156    fi
     157
     158    if [ "$MINDI_EXCLUDE_DEVS" ] ; then
     159        for ed in $MINDI_EXCLUDE_DEVS ; do
    142160            if  [ "`echo " $list_of_devices" | grep " $ed"`" != "" ]; then
    143161                echo $current_VG >> $MINDI_TMP/excludedvgs
     
    160178
    161179    rm -f $MINDI_TMP/pv.tmp2
     180    l=""
    162181    for d in `cat $MINDI_TMP/pv.tmp`; do
    163182        # Skip devices excluded, coming from mondoarchive
    164183        skip=0
    165         if [ "$EXCLUDE_DEVS" ] ; then
    166             for ed in $EXCLUDE_DEVS ; do
    167                 if  [ "`echo " $d " | grep " $ed"`" != "" ]; then
     184        l="$l `mindi --readalllink $d`"
     185        l="$l `GiveMapperOfdm $d`"
     186        list_of_devices="`echo $l | sort -u`"
     187        if [ "$MINDI_EXCLUDE_DEVS" ] ; then
     188            for ed in $MINDI_EXCLUDE_DEVS ; do
     189                if  [ "`echo " $list_of_devices " | grep " $ed"`" != "" ]; then
    168190                    skip=1
    169191                    continue
     
    178200
    179201    if [ -f /etc/multipath.conf ]; then
    180         # If multipath check which type of devidec are given, mpath prefered
    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
    194             GiveMapperOfdm $d
    195         done
    196     else
    197         cat $MINDI_TMP/pv.tmp2
     202        # If multipath check which type of devide are given, mpath prefered
     203        if [ -f  $MINDI_TMP/pv.tmp2 ]; then
     204            l=""
     205            for d in `cat $MINDI_TMP/pv.tmp2`; do
     206                skip=0
     207                l="$l `mindi --readalllink $d`"
     208                l="$l `GiveMapperOfdm $d`"
     209                list_of_devices="`echo $l | sort -u`"
     210                if [ "$MINDI_EXCLUDE_DEVS" ] ; then
     211                    for ed in $MINDI_EXCLUDE_DEVS ; do
     212                        if  [ "`echo " $list_of_devices " | grep " $ed"`" != "" ]; then
     213                            skip=1
     214                            continue
     215                        fi
     216                    done
     217                fi
     218                if [ $skip -eq 1 ]; then
     219                    continue
     220                fi
     221                GiveMapperOfdm $d
     222            done
     223        fi
     224    else
     225        if [ -f  $MINDI_TMP/pv.tmp2 ]; then
     226            cat $MINDI_TMP/pv.tmp2
     227        fi
    198228    fi
    199229    rm -f $MINDI_TMP/pv.tmp $MINDI_TMP/pv.tmp2
     
    233263        fi
    234264        skip=0
    235         if [ "$EXCLUDE_DEVS" ] ; then
    236             for ed in $EXCLUDE_DEVS ; do
     265        if [ "$MINDI_EXCLUDE_DEVS" ] ; then
     266            for ed in $MINDI_EXCLUDE_DEVS ; do
    237267                if  [ "`echo " $rep " | grep " $ed"`" != "" ]; then
    238268                    skip=1
     
    298328fi
    299329
     330if [ _"$MINDI_TMP" = _"" ]; then
     331    # Launched stdalone, so create a temp dir
     332    MINDI_TMP=`mktemp -d $TMPDIR/mindi.XXXXXXXXXX`
     333    if [ $? -ne 0 ]; then
     334        df $TMPDIR
     335        Die "Unable to create a temporary directory ! Check space on $TMPDIR"
     336    fi
     337    if [ _"$MINDI_TMP" = _"" ]; then
     338        Die "MINDI_TMP is empty, aborting"
     339    fi
     340    if [ _"$MINDI_TMP" = _"/" ]; then
     341        Die "MINDI_TMP is /, aborting"
     342    fi
     343fi
     344
    300345# Older lvmdiskscan use --help, newer --version
    301346lvmopt="--help"
     
    328373fi
    329374
     375rm -f $MINDI_TMP/excludedvgs
    330376all_lvm_drives_and_partitions=`ListLvmDrivesAndPartitions`
    331377echo "Just before you extrapolate mountlist to include RAID partitions,"
     
    365411    echo "(mkfs -t foo $i or something like that)"
    366412done
     413rm -f $MINDI_TMP/excludedvgs
    367414WriteShutdownScript
    368415exit 0
Note: See TracChangeset for help on using the changeset viewer.