mirror of
https://github.com/vdsm/virtual-dsm.git
synced 2025-02-24 13:30:02 +08:00
Comments
This commit is contained in:
parent
287cec27a4
commit
abc7b14d73
@ -37,6 +37,7 @@ if [ -f "${DATA}" ]; then
|
|||||||
|
|
||||||
if [ "$ALLOCATE" = "N" ]; then
|
if [ "$ALLOCATE" = "N" ]; then
|
||||||
|
|
||||||
|
# Resize file by changing its length
|
||||||
truncate -s "${DATA_SIZE}" "${DATA}";
|
truncate -s "${DATA_SIZE}" "${DATA}";
|
||||||
|
|
||||||
else
|
else
|
||||||
@ -51,6 +52,7 @@ if [ -f "${DATA}" ]; then
|
|||||||
echo "ERROR: Specify a smaller size or disable preallocation with ALLOCATE=N." && exit 84
|
echo "ERROR: Specify a smaller size or disable preallocation with ALLOCATE=N." && exit 84
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Resize file by allocating more space
|
||||||
if ! fallocate -l "${DATA_SIZE}" "${DATA}"; then
|
if ! fallocate -l "${DATA_SIZE}" "${DATA}"; then
|
||||||
echo "ERROR: Could not allocate a file for the virtual disk." && exit 85
|
echo "ERROR: Could not allocate a file for the virtual disk." && exit 85
|
||||||
fi
|
fi
|
||||||
@ -78,10 +80,9 @@ fi
|
|||||||
|
|
||||||
if [ ! -f "${DATA}" ]; then
|
if [ ! -f "${DATA}" ]; then
|
||||||
|
|
||||||
# Create an empty file
|
|
||||||
|
|
||||||
if [ "$ALLOCATE" = "N" ]; then
|
if [ "$ALLOCATE" = "N" ]; then
|
||||||
|
|
||||||
|
# Create an empty file
|
||||||
truncate -s "${DATA_SIZE}" "${DATA}"
|
truncate -s "${DATA_SIZE}" "${DATA}"
|
||||||
|
|
||||||
else
|
else
|
||||||
@ -94,6 +95,7 @@ if [ ! -f "${DATA}" ]; then
|
|||||||
echo "ERROR: Specify a smaller size or disable preallocation with ALLOCATE=N." && exit 86
|
echo "ERROR: Specify a smaller size or disable preallocation with ALLOCATE=N." && exit 86
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Create an empty file
|
||||||
if ! fallocate -l "${DATA_SIZE}" "${DATA}"; then
|
if ! fallocate -l "${DATA_SIZE}" "${DATA}"; then
|
||||||
rm -f "${DATA}"
|
rm -f "${DATA}"
|
||||||
echo "ERROR: Could not allocate a file for the virtual disk." && exit 87
|
echo "ERROR: Could not allocate a file for the virtual disk." && exit 87
|
||||||
|
Loading…
x
Reference in New Issue
Block a user