branch one, trying a bug fix for another vm disk failure issue

This commit is contained in:
inxi-svn 2013-06-15 00:12:45 +00:00
parent 8e765a8be8
commit c9bdd0a982

29
inxi
View file

@ -3,7 +3,7 @@
#### Script Name: inxi #### Script Name: inxi
#### Version: 1.9.8 #### Version: 1.9.8
#### Date: June 14 2013 #### Date: June 14 2013
#### Patch Number: 06-b1 #### Patch Number: 01-b1
######################################################################## ########################################################################
#### SPECIAL THANKS #### SPECIAL THANKS
######################################################################## ########################################################################
@ -4989,7 +4989,6 @@ get_hdd_data_basic()
fi fi
hdd_data="$( eval $df_string )" hdd_data="$( eval $df_string )"
log_function_data 'raw' "hdd_data:\n$hdd_data" log_function_data 'raw' "hdd_data:\n$hdd_data"
hdd_used=$( echo "$hdd_data" | gawk -v bsdType=$BSD_TYPE ' hdd_used=$( echo "$hdd_data" | gawk -v bsdType=$BSD_TYPE '
BEGIN { BEGIN {
# this is used for specific cases where bind, or incorrect multiple mounts to same partitions, # this is used for specific cases where bind, or incorrect multiple mounts to same partitions,
@ -4998,9 +4997,11 @@ get_hdd_data_basic()
partitionsSet="" partitionsSet=""
# this handles a case where the same dev item is mounted twice to different points # this handles a case where the same dev item is mounted twice to different points
devSet="" devSet=""
devWorking=""
mountWorking=""
} }
# using $1, not $2, because older bsd df do not have -T, filesystem type # using $1, not $2, because older bsd df do not have -T, filesystem type
( bsdType != "" ) && $1 ~ /^(aufs|devfs|devtmpfs|fdescfs|iso9660|linprocfs|procfs|squashfs|sysfs|tmpfs|type|unionfs)$/ { ( bsdType != "" ) && $1 ~ /^(aufs|devfs|devtmpfs|fdescfs|filesystem|iso9660|linprocfs|procfs|squashfs|sysfs|tmpfs|type|unionfs)$/ {
# note use next, not getline or it does not work right # note use next, not getline or it does not work right
next next
} }
@ -5020,23 +5021,27 @@ get_hdd_data_basic()
# this also protects against cases where the mount point has a space in the # this also protects against cases where the mount point has a space in the
# file name, thus breaking going down from $NF directly. # file name, thus breaking going down from $NF directly.
# some bsds will also have only 6 items # some bsds will also have only 6 items
if ( $5 ~ /.*%/ && devSet !~ /.*~$1~.*/ ) { if ( $5 ~ /.*%/ ) {
if ( partitionsSet !~ /.*~$6~.*/ ) { devWorking="~" $1 "~"
mountWorking="~" $6 "~"
if ( partitionsSet !~ mountWorking && devSet !~ devWorking ) {
used += $3 used += $3
} }
partitionsSet = partitionsSet "~" $6 "~" partitionsSet = partitionsSet mountWorking
# make sure to only include bsd real lines here, ie, short df output # make sure to only include bsd real lines here, ie, short df output
if ( $1 ~ /\/dev\// ) { if ( $1 ~ /^\/dev\// ) {
devSet = devSet "~" $1 "~" devSet = devSet devWorking
} }
} }
# otherwise use standard # otherwise use standard
else if ( $6 ~ /.*%/ ) { else if ( $6 ~ /.*%/ ) {
if ( partitionsSet !~ /.*~$7~.*/ && devSet !~ /.*~$1~.*/ ) { devWorking="~" $1 "~"
mountWorking="~" $7 "~"
if ( partitionsSet !~ mountWorking && devSet !~ devWorking ) {
used += $4 used += $4
} }
partitionsSet = partitionsSet "~" $7 "~" partitionsSet = partitionsSet mountWorking
devSet = devSet "~" $1 "~" devSet = devSet devWorking
} }
# and if this is not detected, give up, we need user data to debug # and if this is not detected, give up, we need user data to debug
else { else {
@ -5071,7 +5076,7 @@ get_hdd_data_basic()
# } # }
# special case from this data: 8 0 156290904 sda # special case from this data: 8 0 156290904 sda
# note: vm has 252/253 known starter, grsec has 202 # note: vm has 252/253 known starter, grsec has 202
$1 ~ /^(3|8|22|33|202|252|253)$/ && $NF ~ /[hsv]d[a-z]$/ && ( $2 % 16 == 0 || $2 % 16 == 8 ) { $1 ~ /^(3|8|22|33|202|252|253|254)$/ && $NF ~ /[hsv]d[a-z]$/ && ( $2 % 16 == 0 || $2 % 16 == 8 ) {
size += $3 size += $3
} }