Browse Source

Min size is now ceiled and not truncated in error messages

Matteo Zeccoli Marazzini 1 year ago
parent
commit
7d78986f51
2 changed files with 2 additions and 2 deletions
  1. BIN
      .nfs000000000465d1ed0002b656
  2. 2 2
      parse-arguments.sh

BIN
.nfs000000000465d1ed0002b656


+ 2 - 2
parse-arguments.sh

@@ -45,9 +45,9 @@ default()
 	BEST_SIZE=$(( $(to_sectors 200G) + 2 * $RAM_SIZE ))
 
 	if [ $DEVICE_SIZE -lt $MIN_SIZE ]; then
-		fatal ${MINSIZE_E} "to use default mode, the disk must have at least $(sectors_to_gibibytes ${MIN_SIZE})GB".
+        fatal ${MINSIZE_E} "to use default mode, the disk must have at least $((1 + $(sectors_to_gibibytes ${MIN_SIZE})))GB".
 	elif [ $DEVICE_SIZE -lt $BEST_SIZE ] && [ $FORCE -ne 1 ]; then
-		fatal ${BESTSIZE_E} "to use default mode, it is reccomended that the disk have at least $(sectors_to_gibibytes ${BEST_SIZE})GB. If you know what you are doing, you can force default mode with -f".
+        fatal ${BESTSIZE_E} "to use default mode, it is reccomended that the disk have at least $((1 + $(sectors_to_gibibytes ${BEST_SIZE})))GB. If you know what you are doing, you can force default mode with -f".
 	fi
 	VM_SIZE=$(to_sectors 100G)
 	SWAP_SIZE=$(( $RAM_SIZE + $(to_sectors 1G) ))