
Originally Posted by
chirpy
Just for the future - If a partition doesn't contain enough data to account for the df result, it's usually due to deleted files that are still open. You can check for those using lsof:
lsof /tmp | grep deleted
Which would probably have shown you the guilty MySQL temporary files. 95MB is a tad tiny for most servers which you should normally have at 1GB.
What is the correct way to go about closing those deleted files?
Code:
# lsof /tmp | grep deleted
mysqld 2509 mysql 88u REG 8,6 950632448 21 /tmp/STwzJRVC (deleted)
mysqld 2509 mysql 141u REG 8,6 655360 22 /tmp/STnofBHG (deleted)
My /tmp partition is only 1.1GB and I have a 3.5GB table in mysql I tried to optimize and it has been a running process for over 4 hours now so I don't think it is ever going to finish. I tried this before and ended up just having to restart mysql but then I lost the table. It was permanently "in use" so I just had to drop it and restore a backup.

Originally Posted by
dafut
It may be that mysql is attempting to use /tmp. I had a similar issue before where a mysql process was apparently using /tmp although if I did an "ls -la /tmp" it didn't appear to be.
Solution was to have mysql write to a different temporary directory, which I created by adding:
tmpdir=/home/mysql
in my.cnf; creating the mysql directory in /home/ and giving it mysql.mysql owner.group ownership; then restarting mysql.
Thanks for the information. I think this is what I'm going to have to do. I have a backup partition with plenty of free space so I'll try using that for the mysql tmpdir. Is there any downsides to doing it this way and not using the default /tmp location?