Loading run/disk.sh +26 −20 Original line number Diff line number Diff line Loading @@ -29,6 +29,12 @@ if [ -f "${DATA}" ]; then echo "INFO: Resizing data disk from $OLD_SIZE to $DATA_SIZE bytes.." if [ "$ALLOCATE" != "Y" ]; then truncate -s "${DATA_SIZE}" "${DATA}"; else REQ=$((DATA_SIZE-OLD_SIZE)) # Check free diskspace Loading @@ -43,6 +49,7 @@ if [ -f "${DATA}" ]; then fi fi fi if [ "$DATA_SIZE" -lt "$OLD_SIZE" ]; then Loading @@ -52,18 +59,10 @@ if [ -f "${DATA}" ]; then mv -f "${DATA}" "${DATA}.bak" fi fi if [ ! -f "${DATA}" ]; then # Check free diskspace SPACE=$(df --output=avail -B 1 "${STORAGE}" | tail -n 1) if (( DATA_SIZE > SPACE )); then echo "ERROR: Not enough free space to create virtual disk." && exit 86 fi # Create an empty file if [ "$ALLOCATE" != "Y" ]; then Loading @@ -72,6 +71,13 @@ if [ ! -f "${DATA}" ]; then else # Check free diskspace SPACE=$(df --output=avail -B 1 "${STORAGE}" | tail -n 1) if (( DATA_SIZE > SPACE )); then echo "ERROR: Not enough free space to create virtual disk." && exit 86 fi if ! fallocate -l "${DATA_SIZE}" "${DATA}"; then rm -f "${DATA}" echo "ERROR: Could not allocate file for virtual disk." && exit 87 Loading Loading
run/disk.sh +26 −20 Original line number Diff line number Diff line Loading @@ -29,6 +29,12 @@ if [ -f "${DATA}" ]; then echo "INFO: Resizing data disk from $OLD_SIZE to $DATA_SIZE bytes.." if [ "$ALLOCATE" != "Y" ]; then truncate -s "${DATA_SIZE}" "${DATA}"; else REQ=$((DATA_SIZE-OLD_SIZE)) # Check free diskspace Loading @@ -43,6 +49,7 @@ if [ -f "${DATA}" ]; then fi fi fi if [ "$DATA_SIZE" -lt "$OLD_SIZE" ]; then Loading @@ -52,18 +59,10 @@ if [ -f "${DATA}" ]; then mv -f "${DATA}" "${DATA}.bak" fi fi if [ ! -f "${DATA}" ]; then # Check free diskspace SPACE=$(df --output=avail -B 1 "${STORAGE}" | tail -n 1) if (( DATA_SIZE > SPACE )); then echo "ERROR: Not enough free space to create virtual disk." && exit 86 fi # Create an empty file if [ "$ALLOCATE" != "Y" ]; then Loading @@ -72,6 +71,13 @@ if [ ! -f "${DATA}" ]; then else # Check free diskspace SPACE=$(df --output=avail -B 1 "${STORAGE}" | tail -n 1) if (( DATA_SIZE > SPACE )); then echo "ERROR: Not enough free space to create virtual disk." && exit 86 fi if ! fallocate -l "${DATA_SIZE}" "${DATA}"; then rm -f "${DATA}" echo "ERROR: Could not allocate file for virtual disk." && exit 87 Loading