Add full preallocation (writing zeroes)

This commit is contained in:
Kroese 2023-04-19 03:58:21 +02:00 committed by GitHub
parent e65ab41b7c
commit 0f99873f60

View File

@ -124,11 +124,10 @@ if [ "$ALLOCATE" != "F" ]; then
else else
MB=$(( (SYSTEM_SIZE + 1048575)/1048576 )) GB=$(( (SYSTEM_SIZE + 1073741823)/1073741824 ))
echo "INFO: Writing ${MB} MB of zeroes, please wait.." echo "INFO: Writing ${GB} GB of zeroes, please wait.."
dd if=/dev/zero of="${SYSTEM}" count="${MB}" bs=1M dd if=/dev/zero of="${SYSTEM}" count="${SYSTEM_SIZE}" bs=1M iflag=count_bytes
truncate -s "${SYSTEM_SIZE}" "${SYSTEM}"
fi fi