From 0f99873f604619404c6d76512d997ec123d639dc Mon Sep 17 00:00:00 2001 From: Kroese Date: Wed, 19 Apr 2023 03:58:21 +0200 Subject: [PATCH] Add full preallocation (writing zeroes) --- run/install.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/run/install.sh b/run/install.sh index 5d3a3d6..5be640b 100644 --- a/run/install.sh +++ b/run/install.sh @@ -124,11 +124,10 @@ if [ "$ALLOCATE" != "F" ]; then else - MB=$(( (SYSTEM_SIZE + 1048575)/1048576 )) - echo "INFO: Writing ${MB} MB of zeroes, please wait.." + GB=$(( (SYSTEM_SIZE + 1073741823)/1073741824 )) + echo "INFO: Writing ${GB} GB of zeroes, please wait.." - dd if=/dev/zero of="${SYSTEM}" count="${MB}" bs=1M - truncate -s "${SYSTEM_SIZE}" "${SYSTEM}" + dd if=/dev/zero of="${SYSTEM}" count="${SYSTEM_SIZE}" bs=1M iflag=count_bytes fi