My goal is to get back the storage space in my opt directory. I want to be able to see it growing in size so that regular maintenance checks mean I can down size it when space is needed.

Before I removed mail from mutt I got this disk size output (abreviated):

Filesystem          1K-blocks      Used Available Use% Mounted on
/dev/sda1            38314216  12189488  24155376  34% /
/dev/sda3           144053404 133666076   3046736  98% /opt 237256704  51089408 175959040  23% /opt/www/etl/sftp-homes

Opt drive is low on space (as above):

So I removed old emails (logging), using this

shift + D

This looked like it worked within mutt, as mutt seemed to do its job of removing said files. but df does not give me any of that space back, it is still exactly the same. I assume mutt is hold the file size and possibly needs to be restarted??? or mariadb needs to be restarted/cleaned to release the dbase size??? Or does Centos need to be restarted??? (seems extreme) How do I regain that disk space, or is there another clean up solution here.

FYI, I could not find a way to restart mutt? and restarting mariadb did not work. the majority of the file is held in ibdata1

1 Answer 1


Seems this is a problem with mariadb.



Here is the detail stating the same problem, and that it is too hard: There is a major drawback with the default big MySQL system tablespace approach.

Take this scenario as an example: You’ve uploaded 100GB worth of data into multiple tables in your MySQL.

Now, the ibdata1 file size will be around 100GB+.

# cd /var/lib/mysql

# ls -lh ibdata1
-rw-r-----. 1 mysql mysql 101G Jan 21 21:10 ibdata1

After few days, you deleted around 50GB worth of data from all those tables. The ibdata1 file size will not be reduced to around 50GB+, it will still stay at around 100GB+.

In the above case, later when you add 10GB worth of data to the tables, the ibdata1 file size doesn’t grow to 110GB, and stays at 100GB. Because, the file still has the unused space inside from the above 50GB of deleted data.

The problem is, you can’t reclaim those unused space after you delete the 50GB of data from ibdata1 file. There is a way to do it, but is too complicated, and involves taking the MySQL database down, and dropping all tables etc.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .