Commit 6d2ac1b1 authored by Kroese's avatar Kroese
Browse files

Check free diskspace

parent 4b8a58bc
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -14,7 +14,10 @@ DATA="$IMG/data$DISK_SIZE.img"

if [ ! -f "$DATA" ]; then
    # Create an empty file
    fallocate -l "${NEW_SIZE}" "${DATA}"
    if ! fallocate -l "${NEW_SIZE}" "${DATA}"; then
      rm -f "${DATA}"
      echo "ERROR: Not enough free space to create virtual disk." && exit 88
    fi
    # Format as BTRFS filesystem
    mkfs.btrfs -q -L data -d single -m dup "${DATA}" > /dev/null
fi
+5 −1
Original line number Diff line number Diff line
@@ -101,7 +101,11 @@ echo "Install: Creating partition table..."

SYSTEM="$TMP/sys.img"
SYSTEM_SIZE="4954537983"
fallocate -l "${SYSTEM_SIZE}" "${SYSTEM}"

if ! fallocate -l "${SYSTEM_SIZE}" "${SYSTEM}"; then
  rm -f "${SYSTEM}"
  echo "ERROR: Not enough free space to create virtual disk." && exit 88
fi

PART="$TMP/partition.fdisk"