From 4be338ae1ca30d27da681bc57e94f725825a4273 Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Thu, 11 Dec 2008 11:32:52 +0100 Subject: block device size bugfix --- src/core/libs/lib-blockdevices-filesystems.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/libs/lib-blockdevices-filesystems.sh b/src/core/libs/lib-blockdevices-filesystems.sh index 6b1b30a..4f3ae1b 100644 --- a/src/core/libs/lib-blockdevices-filesystems.sh +++ b/src/core/libs/lib-blockdevices-filesystems.sh @@ -604,10 +604,10 @@ get_blockdevice_size () [ -b "$1" ] || die_error "get_blockdevice_size needs a blockdevice as \$1 ($1 given)" standard=${2:-SI} - if [ "$2" = SI ] + if [ "$standard" = SI ] then BLOCKDEVICE_SIZE=$(hdparm -I $1 | grep -F '1000*1000' | sed "s/^.*:[ \t]*\([0-9]*\) MBytes.*$/\1/") - elif [ "$2" = IEC ] + elif [ "$standard" = IEC ] then blocks=`fdisk -s $1` || show_warning "Fdisk problem" "Something failed when trying to do fdisk -s $1" #NOTE: on some interwebs they say 1 block = 512B, on other internets they say 1 block = 1kiB. 1kiB seems to work for me. don't sue me if it doesn't for you -- cgit v1.2.3-54-g00ecf