Ubuntu – MySQL tmp tables: how to clean up diskspace after killing a copying to tmp table process

disk-space-utilizationinnodbMySQLUbuntu

i ran out of disk space while running an alter table on a large table. I restarted MySQL afterwards and checked the MySQL tmp dir. A show status like '%tmp%' lists 5 tmp files and 4 tmp tables. A df still shows 99% disk usage (was like 72% before the alter table).

Running a "check table" returns "OK".

How to clean up the disk space used by the alter table command?

I'm running MySQL 5.5.31 on Ubuntu 12.04.

Thanks: Lars

Best Answer

Common approach to find where your space has gone.

  1. check for explicit files disk usage with du -ms /path/*.
  2. check "hidden" open files disk usage with lsof | grep deleted | grep /path
  3. last resort: check the file-system consistency.