Changeset 2917


Ignore:
Timestamp:
Dec 18, 2011, 2:52:51 AM (5 years ago)
Author:
bruno
Message:
  • Fix #525 and improve printing when no /etc/raidtab, but still md devices
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.0/mindi/mindi

    r2916 r2917  
    785785# $1: disk device (i.e. /dev/hda1)
    786786GetParentRaidDev() {
     787    if [ ! -f /etc/raidtab ]; then
     788        return
     789    fi
    787790    $AWK "/^[[:space:]]*#/ {next} /^[[:space:]]*raiddev/ {dev=\$2} /^[[:space:]]*device/ {if(\$2==\"$1\") {print dev; exit}}" < /etc/raidtab
    788791}
     
    792795# $1: raid device (/dev/md...)
    793796GetRaidDevMembers() {
     797    if [ ! -f /etc/raidtab ]; then
     798        return
     799    fi
    794800    $AWK "/^[[:space:]]*#/ {next} /^[[:space:]]*raiddev/ {if(dev) exit; if(\$2 == \"$1\") dev=\$2} /^[[:space:]]*device/ {if(dev) {print \$2}}" < /etc/raidtab
    795801}
     
    10661072    useless_dev="/dev/floppy /dev/fd0h1440 /dev/fd0H1440 /dev/cdrom /dev/cdrom/cdrom /dev/cdrom/cdrom1 /dev/cdrom/cdrom2 /dev/cdrom0 /dev/cdrom1 /dev/cdrom2 /dev/cdrom3 /dev/cdrw /dev/scd /dev/ram :/ /dev/sr0 /dev/sr1 /dev/cdrom1"
    10671073    for c_p in $all_partitions ; do
    1068         # Skip evices, network FS, cisf
     1074        # Skip fd/cd devices, network FS, cifs
    10691075        [ "`echo "$useless_dev" | grep -F "$c_p"`" != "" ] || [ "`echo "$c_p" | grep ":"`" != "" ] || [ "`echo "$c_p" | grep -E "^//"`" != "" ]&& continue
    10701076        [ "`echo "$c_p" | grep -x "/dev/cdroms.*"`" ] && continue
     
    22062212    local devpath drive res stub
    22072213    device=$1
     2214    if [ "`echo "$device" | grep -E "^/dev/"`" = "" ] ; then
     2215        Die "Cannot find $device's size - is your /etc/fstab sane?"
     2216    fi
    22082217    if [ "`echo "$device" | grep -F "/dev/md"`" != "" ] ; then
    22092218        res=`SizeOfRaidPartition $device`
Note: See TracChangeset for help on using the changeset viewer.