mirror of
https://github.com/vdsm/virtual-dsm.git
synced 2025-02-24 13:30:02 +08:00
Preallocate by default
Preallocate by default
This commit is contained in:
commit
d6bb08b029
@ -115,24 +115,9 @@ if (( SYSTEM_SIZE > SPACE )); then
|
||||
echo "ERROR: Not enough free space to create a 4 GB system disk." && exit 87
|
||||
fi
|
||||
|
||||
if [ "$ALLOCATE" != "Z" ]; then
|
||||
|
||||
# Cannot use truncate here because of swap partition
|
||||
|
||||
if ! fallocate -l "${SYSTEM_SIZE}" "${SYSTEM}"; then
|
||||
rm -f "${SYSTEM}"
|
||||
echo "ERROR: Could not allocate a file for the system disk." && exit 88
|
||||
fi
|
||||
|
||||
else
|
||||
|
||||
GB=$(( (SYSTEM_SIZE + 1073741823)/1073741824 ))
|
||||
echo "Install: Writing ${GB} GB of random data, please wait.."
|
||||
|
||||
echo "Install: Allocating diskspace..."
|
||||
dd if=/dev/urandom of="${SYSTEM}" count="${SYSTEM_SIZE}" bs=1M iflag=count_bytes status=none
|
||||
|
||||
fi
|
||||
|
||||
# Check if file exists
|
||||
if [ ! -f "${SYSTEM}" ]; then
|
||||
echo "ERROR: System disk does not exist ($SYSTEM)" && exit 89
|
||||
|
Loading…
x
Reference in New Issue
Block a user