mirror of
https://github.com/vdsm/virtual-dsm.git
synced 2025-02-24 13:30:02 +08:00
Always allocate
This commit is contained in:
parent
d6bb08b029
commit
13bd4c60ea
27
run/disk.sh
27
run/disk.sh
@ -45,19 +45,17 @@ if [ -f "${DATA}" ]; then
|
||||
echo "ERROR: Specify a smaller size or disable preallocation with ALLOCATION=N." && exit 84
|
||||
fi
|
||||
|
||||
if ! fallocate -l "${DATA_SIZE}" "${DATA}"; then
|
||||
echo "ERROR: Could not allocate a file for the virtual disk." && exit 85
|
||||
fi
|
||||
|
||||
if [ "$ALLOCATE" = "Z" ]; then
|
||||
|
||||
GB=$(( (REQ + 1073741823)/1073741824 ))
|
||||
echo "INFO: Writing ${GB} GB of random data, please wait.."
|
||||
|
||||
echo "INFO: Preallocating ${GB} GB with random data, please wait.."
|
||||
dd if=/dev/urandom of="${DATA}" seek="${OLD_SIZE}" count="${REQ}" bs=1M iflag=count_bytes oflag=seek_bytes status=none
|
||||
|
||||
else
|
||||
|
||||
if ! fallocate -l "${DATA_SIZE}" "${DATA}"; then
|
||||
echo "ERROR: Could not allocate a file for the virtual disk." && exit 85
|
||||
fi
|
||||
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
@ -90,19 +88,16 @@ if [ ! -f "${DATA}" ]; then
|
||||
echo "ERROR: Specify a smaller size or disable preallocation with ALLOCATION=N." && exit 86
|
||||
fi
|
||||
|
||||
if ! fallocate -l "${DATA_SIZE}" "${DATA}"; then
|
||||
rm -f "${DATA}"
|
||||
echo "ERROR: Could not allocate a file for the virtual disk." && exit 87
|
||||
fi
|
||||
|
||||
if [ "$ALLOCATE" = "Z" ]; then
|
||||
|
||||
echo "INFO: Writing ${DISK_SIZE} of random data, please wait.."
|
||||
|
||||
echo "INFO: Preallocating ${DISK_SIZE} with random data, please wait.."
|
||||
dd if=/dev/urandom of="${DATA}" count="${DATA_SIZE}" bs=1M iflag=count_bytes status=none
|
||||
|
||||
else
|
||||
|
||||
if ! fallocate -l "${DATA_SIZE}" "${DATA}"; then
|
||||
rm -f "${DATA}"
|
||||
echo "ERROR: Could not allocate a file for the virtual disk." && exit 87
|
||||
fi
|
||||
|
||||
fi
|
||||
fi
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user