summaryrefslogtreecommitdiff
path: root/debian/mariadb-server.preinst
diff options
context:
space:
mode:
Diffstat (limited to 'debian/mariadb-server.preinst')
-rw-r--r--debian/mariadb-server.preinst6
1 files changed, 4 insertions, 2 deletions
diff --git a/debian/mariadb-server.preinst b/debian/mariadb-server.preinst
index 755815eaeed..e2d8e670bbf 100644
--- a/debian/mariadb-server.preinst
+++ b/debian/mariadb-server.preinst
@@ -196,8 +196,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