Changeset 2546 in MondoRescue for branches/2.2.10/mindi
- Timestamp:
- Jan 21, 2010, 8:50:00 PM (15 years ago)
- Location:
- branches/2.2.10/mindi
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.10/mindi/README.bootparam
r2484 r2546 26 26 donteject 27 27 mondorestore will not eject the CD; this is useful if, for instance, your PC's case has a concealed CD-ROM drive 28 29 excludedevs="dev1 dev2" 30 Exclude those evices from retoration process (no LVM action done suc has pvcreate, and no partitioning. Those devices are removed from /tmp/mountlist.txt and /tmp/i-want-my-lvm) 28 31 29 32 forcemods="mod1 mod2" … … 58 61 59 62 pre=/path/to/script 60 Execute a pre-configuration script before calling mondorestore. Could be an NFS shared script e.g., or a script located in the initrd. 63 Execute a pre-configuration script before calling mondorestore. Could be an NFS shared script e.g., or a script located in the initrd. Eg: pre=/tmp/isodir/my-pre.sh. Note that the script should be executable. 61 64 62 65 post=/path/to/script 63 Execute a final script before rebooting the machine at the end of the restoration. Could be an NFS shared script e.g., or a script located on the restored disk or in the initrd. 66 Execute a final script before rebooting the machine at the end of the restoration. Could be an NFS shared script e.g., or a script located on the restored disk or in the initrd. Eg: post=/tmp/isodir/my-post.sh. Note that the script should be executable. 64 67 65 68 serial=/dev/ttySx -
branches/2.2.10/mindi/analyze-my-lvm
r2428 r2546 51 51 fi 52 52 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 54 60 } 55 61 … … 131 137 fi 132 138 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 133 148 echo "# $LVMCMD vgcreate $current_VG$VG_params $list_of_devices" 134 149 echo "# $LVMCMD vgchange -a y $current_VG" … … 143 158 pvscan 2> /dev/null | grep '"' | cut -d'"' -f2 > $MINDI_TMP/pv.tmp 144 159 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 145 179 if [ -f /etc/multipath.conf ]; then 146 180 # 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 148 194 GiveMapperOfdm $d 149 195 done 150 196 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 154 200 } 155 201 … … 177 223 178 224 ListLvmDrivesAndPartitions() { 225 # We get partitions in this loop not devices 179 226 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 185 228 if [ -f /etc/multipath.conf ]; then 186 GiveMapperOfdm $d 229 i=`GiveMapperOfdm $d` 230 rep=$i 187 231 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 190 247 done 191 248 } -
branches/2.2.10/mindi/mindi
r2514 r2546 959 959 LVM="false" 960 960 fi 961 # Excluded LVs and GVs are not reported here 961 962 all_partitions=`cat $MINDI_TMP/lvm.res | grep -F ">>>" | cut -d' ' -f2-` 962 963 fi 963 964 all_partitions="$all_partitions `ListAllPartitions 2> /dev/null`" 964 # echo "all partitions = $all_partitions" > /dev/stderr965 965 for i in $IMAGE_DEVS ; do 966 966 mount | grep -F "$i " > /dev/null 2> /dev/null && Die "Sorry, $i is already mounted! CANNOT DO IMAGEDEV on it if it's mounted." … … 1234 1234 fi 1235 1235 fi 1236 if [ "$EXCLUDE_DEVS" ] && [ "`echo " $EXCLUDE_DEVS " | grep -F " $current_partition "`" ] || [ "`echo " $EXCLUDE_DEVS " | grep " $current_partition "`" ] ; then 1237 LogFile "Excluding $current_partition from mountlist" 1238 continue 1236 skip=0 1237 if [ "$EXCLUDE_DEVS" ] ; then 1238 for d in $EXCLUDE_DEVS ; do 1239 if [ "`echo " $current_partition " | grep " $d"`" != "" ]; then 1240 LogFile "Excluding $current_partition from mountlist (due to excluded device $d)" 1241 skip=1 1242 continue 1243 fi 1244 done 1245 fi 1246 if [ $skip -eq 1 ]; then 1247 continue 1239 1248 fi 1240 1249 if [ ! "$partition_mountpt" ] ; then … … 1292 1301 local file=$1 1293 1302 # Coherency verification 1294 ML0=`cat $file | wc -l` 1303 ML01=`cat $file | wc -l` 1304 ML02=`cat $file | grep -v ' lvm ' | wc -l` 1295 1305 ML1=`$AWK '{print $1}' $file | sort -u | wc -l` 1296 ML2=`$AWK '{print $2}' $file | sort -u | wc -l`1297 if [ "$ML0 " -ne "$ML1" ]; then1306 ML2=`$AWK '{print $2}' $file | grep -v ' lvm ' | sort -u | wc -l` 1307 if [ "$ML01" -ne "$ML1" ]; then 1298 1308 LogFile "--------------------------------------------" 1299 1309 echo "WARNING: Duplicate device entry in mountlist" | tee -a $LOGFILE 1300 1310 LogFile "--------------------------------------------" 1301 1311 fi 1302 if [ "$ML0 " -ne "$ML2" ]; then1312 if [ "$ML02" -ne "$ML2" ]; then 1303 1313 LogFile "--------------------------------------------" 1304 1314 echo "WARNING: Duplicate mountpoint entry in mountlist" | tee -a $LOGFILE -
branches/2.2.10/mindi/rootfs/sbin/init
r2508 r2546 391 391 vgscan 392 392 fi 393 394 # Exclude devices we may not want 395 rm -f /tmp/restorevgs 396 for d in $EXCLUDE_DEVS ; do 397 echo " == $d" 398 EXCLUDE_VGS=`grep " $d" /tmp/i-want-my-lvm | grep vgcreate | awk '{print $4}'` 399 vg=`echo $EXCLUDE_VGS | sed "s/ /|/g"` 400 if [ "$vg" != "" ]; then 401 re=" $d|$vg" 402 else 403 re=" $d" 404 fi 405 # Remove VGs from i-want-my-lvm 406 grep -Ev "$re" /tmp/i-want-my-lvm > /tmp/i-want-my-lvm.new 407 mv /tmp/i-want-my-lvm.new /tmp/i-want-my-lvm 408 # Prepare script to restore the VG exluded here if needed 409 for v in $EXCLUDE_VGS; do 410 echo "vgcfgrestore $v" >> /tmp/restorevgs 411 # Remove LVs from mountlist 412 EXCLUDE_LVS=`grep " $v" /tmp/i-want-my-lvm | grep lvcreate | sed "s/^.*-n \([^ ][^ ]*\) .*$/$1/"` 413 for l in $EXCLUDE_LVS; do 414 # FIXME: Should search for all possible device names here 415 grep -Ev "/dev/$v/$l" /tmp/mountlist.txt > /tmp/mountlist.txt.new 416 grep -Ev "/dev/mapper/${v}-v$l" /tmp/mountlist.txt.new > /tmp/mountlist.txt 417 done 418 done 419 done 420 393 421 grep -E "^#.*vgchange" /tmp/i-want-my-lvm | sed "s/^#[ ]*//" > /tmp/start-lvm 394 422 chmod +x /tmp/start-lvm … … 685 713 export FORCE_MODS=" " 686 714 fi 715 if [ "`grep -i excludedevs /proc/cmdline`" ]; then 716 export EXCLUDE_DEVS="`cat /proc/cmdline | sed 's~.*excludedevs=\"\(.*\)\".*~\1~'` mondonone" 717 else 718 export EXCLUDE_DEVS=" " 719 fi 687 720 688 721 echo "Activating a potential USB keyboard/mouse" … … 831 864 # start-netfs moved it under /tmp as the NFS share is already unmounted 832 865 if [ "`echo $pre | grep -E '^/tmp/isodir'`" ]; then 833 p ost=`echo $pre | sed 's|^/tmp/isodir|/tmp|'`866 pre=`echo $pre | sed 's|^/tmp/isodir|/tmp|'` 834 867 fi 835 868 if [ -x $pre ]; then
Note:
See TracChangeset
for help on using the changeset viewer.