|
|
|
@ -73,23 +73,24 @@ prepare() { |
|
|
|
rm -rf ${DB_LOCATION}/../db-backup-temp |
|
|
|
elif [ $mountcurrentsize -gt $mountwantedsize ]; then |
|
|
|
# check if it fits |
|
|
|
echo "wanted size of $mountwantedsize is below current size of $mountcurrentsize , remounting" |
|
|
|
echo "wanted size of $mountwantedsize is below current size of $mountcurrentsize , checking sizes" |
|
|
|
mountusedsize=$(mount_point_used_size) |
|
|
|
requiredsize=$(( mountusedsize * (100 + ${RAM_DISK_FREE_SIZE_PERC}) / 100)) |
|
|
|
if [ $requiredsize -gt $mountwantedsize ]; then |
|
|
|
echo "wanted size of $mountwantedsize doesn't have enough space for required size of $requiredsize , setting to $requiredsize" |
|
|
|
echo "wanted size of $mountwantedsize doesn't have enough space for required size of $requiredsize" |
|
|
|
mountwantedsize=$requiredsize |
|
|
|
else |
|
|
|
echo "resizing from $mountcurrentsize to $mountwantedsize" |
|
|
|
rm -rf ${DB_LOCATION}/../db-backup-temp |
|
|
|
mkdir -p ${DB_LOCATION}/../db-backup-temp |
|
|
|
cp -f ${DB_LOCATION}/* ${DB_LOCATION}/../db-backup-temp/ |
|
|
|
umount ${DB_LOCATION} |
|
|
|
rm -rf ${DB_LOCATION} |
|
|
|
mkdir -p ${DB_LOCATION} |
|
|
|
mount -t tmpfs -o size=$mountwantedsize tmpfs ${DB_LOCATION} |
|
|
|
cp -f ${DB_LOCATION}/../db-backup-temp/* ${DB_LOCATION}/ |
|
|
|
rm -rf ${DB_LOCATION}/../db-backup-temp |
|
|
|
fi |
|
|
|
echo "resizing from $mountcurrentsize to $mountwantedsize" |
|
|
|
rm -rf ${DB_LOCATION}/../db-backup-temp |
|
|
|
mkdir -p ${DB_LOCATION}/../db-backup-temp |
|
|
|
cp -f ${DB_LOCATION}/* ${DB_LOCATION}/../db-backup-temp/ |
|
|
|
umount ${DB_LOCATION} |
|
|
|
rm -rf ${DB_LOCATION} |
|
|
|
mkdir -p ${DB_LOCATION} |
|
|
|
mount -t tmpfs -o size=$mountwantedsize tmpfs ${DB_LOCATION} |
|
|
|
cp -f ${DB_LOCATION}/../db-backup-temp/* ${DB_LOCATION}/ |
|
|
|
rm -rf ${DB_LOCATION}/../db-backup-temp |
|
|
|
fi |
|
|
|
fi |
|
|
|
else |
|
|
|
|