Browse Source
Merge pull request #369 from planetrocky/main
get_size_gb() calculation error for 20GB HDDs.
pull/370/head
Dave Russell
1 year ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
3 additions and
5 deletions
-
syno_hdd_db.sh
|
|
@ -896,11 +896,9 @@ fixdrivemodel(){ |
|
|
|
|
|
|
|
|
get_size_gb(){ |
|
|
get_size_gb(){ |
|
|
# $1 is /sys/block/sata1 or /sys/block/nvme0n1 etc |
|
|
# $1 is /sys/block/sata1 or /sys/block/nvme0n1 etc |
|
|
local float |
|
|
local disk_size_gb |
|
|
local int |
|
|
disk_size_gb=$(synodisk --info /dev/"$(basename -- "$1")" | grep 'Total capacity' | awk '{print int($4 * 1.073741824)}') |
|
|
float=$(synodisk --info /dev/"$(basename -- "$1")" | grep 'Total capacity' | awk '{print $4 * 1.0737}') |
|
|
echo "$disk_size_gb" |
|
|
int="${float%.*}" |
|
|
|
|
|
echo "$int" |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
getdriveinfo(){ |
|
|
getdriveinfo(){ |
|
|
|