summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--debian/mariadb-server-10.6.mariadb.init5
-rw-r--r--debian/mariadb-server-10.6.preinst6
2 files changed, 8 insertions, 3 deletions
diff --git a/debian/mariadb-server-10.6.mariadb.init b/debian/mariadb-server-10.6.mariadb.init
index 0bc7a972e88..b2b7142084f 100644
--- a/debian/mariadb-server-10.6.mariadb.init
+++ b/debian/mariadb-server-10.6.mariadb.init
@@ -84,7 +84,10 @@ sanity_checks() {
# check for diskspace shortage
datadir=`mariadbd_get_param datadir`
- if LC_ALL=C BLOCKSIZE= df --portability $datadir/. | tail -n 1 | awk '{ exit ($4>4096) }'; then
+ # As preset blocksize of GNU df is 1024 then available bytes is $df_available_blocks * 1024
+ # 4096 blocks is then lower than 4 MB
+ df_available_blocks=`LC_ALL=C BLOCKSIZE= df --output=avail "$datadir" | tail -n 1`
+ if [ "$df_available_blocks" -lt "4096" ]; then
log_failure_msg "$0: ERROR: The partition with $datadir is too full!"
echo "ERROR: The partition with $datadir is too full!" | $ERR_LOGGER
exit 1
diff --git a/debian/mariadb-server-10.6.preinst b/debian/mariadb-server-10.6.preinst
index b79f20a9803..c865173e29e 100644
--- a/debian/mariadb-server-10.6.preinst
+++ b/debian/mariadb-server-10.6.preinst
@@ -209,8 +209,10 @@ if [ ! -d $mysql_datadir ] && [ ! -L $mysql_datadir ]; then
mkdir -Z $mysql_datadir
fi
-# checking disc space
-if LC_ALL=C BLOCKSIZE= df --portability $mysql_datadir/. | tail -n 1 | awk '{ exit ($4>1000) }'; then
+# As preset blocksize of GNU df is 1024 then available bytes is $df_available_blocks * 1024
+# 4096 blocks is then lower than 4 MB
+df_available_blocks=`LC_ALL=C BLOCKSIZE= df --output=avail "$datadir" | tail -n 1`
+if [ "$df_available_blocks" -lt "4096" ]; then
echo "ERROR: There's not enough space in $mysql_datadir/" 1>&2
db_stop
exit 1