diff options
author | Dieter Plaetinck <dieter@plaetinck.be> | 2008-12-06 13:25:30 +0100 |
---|---|---|
committer | Dieter Plaetinck <dieter@plaetinck.be> | 2008-12-06 13:25:30 +0100 |
commit | ba32e0816e86cbd44db7baa38ef4def7fe806b86 (patch) | |
tree | 611d19316ddd5bce2c12379b46d2055420468b7e /src/core/libs/lib-blockdevices-filesystems.sh | |
parent | 31a4a4b45fd6184e1d090820010a20aa67abbdfe (diff) |
fix + show size of part in menu
Diffstat (limited to 'src/core/libs/lib-blockdevices-filesystems.sh')
-rw-r--r-- | src/core/libs/lib-blockdevices-filesystems.sh | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/core/libs/lib-blockdevices-filesystems.sh b/src/core/libs/lib-blockdevices-filesystems.sh index 8e49fbf..b271900 100644 --- a/src/core/libs/lib-blockdevices-filesystems.sh +++ b/src/core/libs/lib-blockdevices-filesystems.sh @@ -510,4 +510,15 @@ get_filesystem_program () [ $1 = lvm-vg ] && echo vgcreate [ $1 = lvg-lv ] && echo lvcreate [ $1 = dm_crypt ] && echo cryptsetup -}
\ No newline at end of file +} + + +# $1 blockdevice +# output will be in $BLOCKDEVICE_SIZE in MB +get_blockdevice_size () +{ + [ -b "$1" ] || die_error "get_blockdevice_size needs a blockdevice as \$1 ($1 given)" + blocks=`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 + BLOCKDEVICE_SIZE=$(($blocks/1024)) +} |