mirror of
https://github.com/AuxXxilium/arv-v-dsm.git
synced 2024-12-18 04:27:51 +07:00
Check free diskspace
This commit is contained in:
parent
c88072c97e
commit
77eb81c6fe
5
disk.sh
5
disk.sh
@ -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
|
||||
|
@ -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"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user