diff --git a/scripts/cloudron-setup b/scripts/cloudron-setup index 56908fa61..349e1b5cb 100755 --- a/scripts/cloudron-setup +++ b/scripts/cloudron-setup @@ -15,7 +15,7 @@ fi # change this to a hash when we make a upgrade release readonly LOG_FILE="/var/log/cloudron-setup.log" readonly DATA_FILE="/root/cloudron-install-data.json" -readonly MINIMUM_DISK_SIZE_GB="19" # this is the size of "/" and required to fit in docker images 19 is a safe bet for different reporting on 20GB min +readonly MINIMUM_DISK_SIZE_GB="18" # this is the size of "/" and required to fit in docker images 18 is a safe bet for different reporting on 20GB min readonly MINIMUM_MEMORY="974" # this is mostly reported for 1GB main memory (DO 992, EC2 990, Linode 989, Serverdiscounter.com 974) readonly curl="curl --fail --connect-timeout 20 --retry 10 --retry-delay 2 --max-time 2400" @@ -23,8 +23,8 @@ readonly curl="curl --fail --connect-timeout 20 --retry 10 --retry-delay 2 --max # copied from cloudron-resize-fs.sh readonly physical_memory=$(LC_ALL=C free -m | awk '/Mem:/ { print $2 }') readonly disk_device="$(for d in $(find /dev -type b); do [ "$(mountpoint -d /)" = "$(mountpoint -x $d)" ] && echo $d && break; done)" -readonly disk_size_bytes=$(LC_ALL=C fdisk -l ${disk_device} | grep "Disk ${disk_device}" | awk '{ printf $5 }') -readonly disk_size_gb=$((${disk_size_bytes}/1024/1024/1024)) +readonly disk_size_bytes=$(LC_ALL=C df | grep "${disk_device}" | awk '{ printf $2 }') +readonly disk_size_gb=$((${disk_size_bytes}/1024/1024)) # verify the system has minimum requirements met if [[ "${physical_memory}" -lt "${MINIMUM_MEMORY}" ]]; then diff --git a/setup/start/cloudron-resize-fs.sh b/setup/start/cloudron-resize-fs.sh index ee7bdc604..63f16ba8a 100755 --- a/setup/start/cloudron-resize-fs.sh +++ b/setup/start/cloudron-resize-fs.sh @@ -16,8 +16,8 @@ existing_swap=$(cat /proc/meminfo | grep SwapTotal | awk '{ printf "%.0f", $2/10 readonly physical_memory=$(LC_ALL=C free -m | awk '/Mem:/ { print $2 }') readonly swap_size=$((${physical_memory} - ${existing_swap})) # if you change this, fix enoughResourcesAvailable() in client.js readonly app_count=$((${physical_memory} / 200)) # estimated app count -readonly disk_size_bytes=$(LC_ALL=C fdisk -l ${disk_device} | grep "Disk ${disk_device}" | awk '{ printf $5 }') # can't rely on fdisk human readable units, using bytes instead -readonly disk_size=$((${disk_size_bytes}/1024/1024)) +readonly disk_size_bytes=$(LC_ALL=C df | grep "${disk_device}" | awk '{ printf $2 }') +readonly disk_size=$((${disk_size_bytes}/1024)) readonly system_size=10240 # 10 gigs for system libs, apps images, installer, box code, data and tmp readonly ext4_reserved=$((disk_size * 5 / 100)) # this can be changes using tune2fs -m percent /dev/vda1