From ac93aca125836ed541711787ec22003d89f7391b Mon Sep 17 00:00:00 2001 From: thorstenspille Date: Wed, 4 Oct 2023 06:33:50 +0200 Subject: [PATCH] Fix ZFS_ARC_MIN calculation --- postinstall | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/postinstall b/postinstall index 69f178f..6a9f512 100755 --- a/postinstall +++ b/postinstall @@ -110,8 +110,14 @@ cancel_dialog() { } arc_suggestion(){ - ZFS_ARC_MIN_MEGABYTES=$(roundoff $(($ZPOOL_SIZE_SUM_BYTES / 2048 / 1024 / 1024))) ZFS_ARC_MAX_MEGABYTES=$(roundup $(($ZPOOL_SIZE_SUM_BYTES / 1024 / 1024 / 1024))) + ZFS_ARC_MIN_MEGABYTES=$(roundoff $(($ZPOOL_SIZE_SUM_BYTES / 2048 / 1024 / 1024))) + if [ $ZFS_ARC_MIN_MEGABYTES -eq 0 ]; then + ZFS_ARC_MIN_MEGABYTES=$(($ZFS_ARC_MAX_MEGABYTES / 2)) + if [ $ARC_MIN_DEFAULT_MB -gt $ZFS_ARC_MAX_MEGABYTES ]; then + ZFS_ARC_MIN_MEGABYTES=$ARC_MIN_DEFAULT_MB + fi + fi if [ $ARC_MIN_DEFAULT_BYTES -lt 33554432 ]; then ARC_MIN_DEFAULT_MB="32" ; else ARC_MIN_DEFAULT_MB="$(($ARC_MIN_DEFAULT_BYTES / 1024 / 1024))" ; fi if [ $ARC_MIN_CUR_BYTES -gt 0 ]; then ARC_MIN_CURRENT_MB="$(($ARC_MIN_CUR_BYTES / 1024 / 1024))" ; else ARC_MIN_CURRENT_MB="0" ; fi