diff --git a/partition.sh b/partition.sh index ec42d65..0d512d9 100755 --- a/partition.sh +++ b/partition.sh @@ -44,6 +44,10 @@ sgdisk \ if [[ "${ENABLE_SWAP}" == "yes" ]]; then SWAP_SIZE="$(((($(vmstat -sS M | grep 'total memory' | sed 's/ M total memory//') / 1024) + 1) * 2))" + if [[ "${SWAP_SIZE#}" -gt '32' ]]; then + SWAP_SIZE='32' + fi + sgdisk \ -n2:0:+${SWAP_SIZE}G \ -t2:BF02 \