Changeset 739 in MondoRescue for branches/stable/mindi/mindi
- Timestamp:
- Aug 4, 2006, 11:54:47 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/stable/mindi/mindi
r735 r739 1445 1445 items=0 1446 1446 for i in `tr -s ' ' '\t' < /proc/swaps | grep -Fv "Filename" | cut -f3` ; do 1447 totalsize=$(($totalsize+$i))1448 items=$(($items+1))1447 totalsize=$(($totalsize+$i)) 1448 items=$(($items+1)) 1449 1449 done 1450 1450 [ "$items" -gt "0" ] && partition_size=$(($totalsize/$items)) || partition_size=0 1451 1451 [ "$partition_size" -lt "125000" ] && partition_size=125000 1452 1452 echo "I'm guessing $c_p is $(($partition_size/1024))MB" >> $LOGFILE … … 1458 1458 if [ "$partition_mountpt" = "" ] ; then 1459 1459 if [ "`pvdisplay $current_lvolume 2> /dev/null`" != "" ] || [ "`lvm pvdisplay $current_lvolume 2> /dev/null`" != "" ] ; then 1460 if [ "`grep -F device /etc/raidtab 2> /dev/null | grep -w $current_partition`" ] ; then1461 partition_mountpt="raid"1462 partition_format="raid"1463 else1464 # lvm_dev="`pvdisplay $current_lvolume | grep -i "VG N" | head -n1 | tr -s ' ' ' ' | cut -d' ' -f3`"1465 partition_mountpt="lvm"1466 partition_format="lvm"1467 fi1460 if [ "`grep -F device /etc/raidtab 2> /dev/null | grep -w $current_partition`" ] ; then 1461 partition_mountpt="raid" 1462 partition_format="raid" 1463 else 1464 # lvm_dev="`pvdisplay $current_lvolume | grep -i "VG N" | head -n1 | tr -s ' ' ' ' | cut -d' ' -f3`" 1465 partition_mountpt="lvm" 1466 partition_format="lvm" 1467 fi 1468 1468 fi 1469 1469 fi … … 1473 1473 if [ "`echo " $IMAGE_DEVS " | grep -F " $current_partition "`" != "" ] ; then 1474 1474 partition_mountpt="image" 1475 1475 old_partition_fmt=$partition_format 1476 1476 # partition_format="`$FDISK -l 2>> $LOGFILE | tr -s '\t' ' ' | grep -w "$absolute_partition" | $AWK 'x=$(NF-1}'`" 1477 1477 partition_format="`$FDISK -l 2>> $LOGFILE | tr '*' ' ' | tr '+' ' ' | tr -s ' ' '\t' | grep -w "$absolute_partition" | cut -f5`" 1478 1479 1480 1478 echo "------- $FDISK -l log ------------" >> $LOGFILE 1479 cat $FDISKLOG >> $LOGFILE 1480 echo "------- $FDISK log end ------------" >> $LOGFILE 1481 1481 partition_size=$(($partition_size+1)); # just in case 1482 1483 1484 1485 1486 1487 fi 1488 1489 1490 1491 1492 1482 if [ "$partition_format" = "Linux" ] ; then 1483 echo "Are you imaging a mounted swap partition? Silly..." >> $LOGFILE 1484 echo "Reverting format from $old_partition_fmt to $partition_format" >> $LOGFILE 1485 partition_format=$old_partition_fmt 1486 fi 1487 fi 1488 if [ "$EXCLUDE_DEVS" ] && [ "`echo " $EXCLUDE_DEVS " | grep -F " $current_partition "`" ] || [ "`echo " $EXCLUDE_DEVS " | grep " $current_partition "`" ] ; then 1489 echo "Excluding $current_partition from mountlist" >> $LOGFILE 1490 continue 1491 fi 1492 if [ ! "$partition_mountpt" ] ; then 1493 1493 for qq in "" `find /dev/ida/c*d* ! -name '*p*'` ; do 1494 partition_format=`$FDISK -l $qq 2>> $LOGFILE | grep -w "$c_p" | sed 's/12/|/' | tr -s '\t' ' ' | cut -d'|' -f2 | cut -d' ' -f2-9`1495 1496 1497 1498 [ "$partition_format" ] && break1494 partition_format=`$FDISK -l $qq 2>> $LOGFILE | grep -w "$c_p" | sed 's/12/|/' | tr -s '\t' ' ' | cut -d'|' -f2 | cut -d' ' -f2-9` 1495 echo "------- $FDISK -l $qq log ------------" >> $LOGFILE 1496 cat $FDISKLOG >> $LOGFILE 1497 echo "------- $FDISK log end ------------" >> $LOGFILE 1498 [ "$partition_format" ] && break 1499 1499 done 1500 1500 if [ "$partition_format" = "Compaq diagnostics" ] ; then 1501 partition_format="compaq"1501 partition_format="compaq" 1502 1502 elif [ ! "`grep -F device /etc/raidtab 2> /dev/null | grep -w $current_partition`" ] ; then 1503 LogIt "Unable to find mountpoint of $current_partition - ignoring\n"1504 continue1503 LogIt "Unable to find mountpoint of $current_partition - ignoring\n" 1504 continue 1505 1505 fi 1506 1506 fi … … 1519 1519 echo "Unknown mountpoint (outstring = $unofficial_outstring)" >> $LOGFILE 1520 1520 fi 1521 1521 elif [ "$partition_format" = "" ] ; then 1522 1522 echo "Unknown format (outstring = $unofficial_outstring)" >> $LOGFILE 1523 1523 elif [ "$partition_size" = "" ] ; then … … 1526 1526 continue 1527 1527 else 1528 1529 1530 1531 1528 if [ "$partition_format" = "dos" ] || [ "$partition_format" = "msdos" ] ; then 1529 echo "Stupid bastard..." >> $LOGFILE 1530 partition_format="vfat" 1531 fi 1532 1532 printf "\t%-15s %-15s %-15s %7s %-15s\n" $current_partition $partition_mountpt $partition_format $psz "$redhat_label" 1533 1533 printf "%s %s %s %s %s\n" $current_partition $partition_mountpt $partition_format $partition_size "$redhat_label" >> $mountlist
Note:
See TracChangeset
for help on using the changeset viewer.