Use fallocate instead of truncate

This commit is contained in:
Kroese 2023-04-15 01:59:06 +02:00 committed by GitHub
parent 5bd90dc285
commit c88072c97e

View File

@ -14,7 +14,7 @@ DATA="$IMG/data$DISK_SIZE.img"
if [ ! -f "$DATA" ]; then
# Create an empty file
truncate -s "${NEW_SIZE}" "${DATA}"
fallocate -l "${NEW_SIZE}" "${DATA}"
# Format as BTRFS filesystem
mkfs.btrfs -q -L data -d single -m dup "${DATA}" > /dev/null
fi