mirror of
https://github.com/vdsm/virtual-dsm.git
synced 2025-02-24 21:40:01 +08:00
Preallocate by default
This commit is contained in:
parent
b9c2e1cba2
commit
b7abf2fe15
@ -115,23 +115,8 @@ if (( SYSTEM_SIZE > SPACE )); then
|
|||||||
echo "ERROR: Not enough free space to create a 4 GB system disk." && exit 87
|
echo "ERROR: Not enough free space to create a 4 GB system disk." && exit 87
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$ALLOCATE" != "Z" ]; then
|
echo "Install: Allocating diskspace..."
|
||||||
|
dd if=/dev/urandom of="${SYSTEM}" count="${SYSTEM_SIZE}" bs=1M iflag=count_bytes status=none
|
||||||
# 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.."
|
|
||||||
|
|
||||||
dd if=/dev/urandom of="${SYSTEM}" count="${SYSTEM_SIZE}" bs=1M iflag=count_bytes status=none
|
|
||||||
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Check if file exists
|
# Check if file exists
|
||||||
if [ ! -f "${SYSTEM}" ]; then
|
if [ ! -f "${SYSTEM}" ]; then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user