Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

share|improve this question
    
you can use some ram partition for tmptable instead of hdd, this can be better for space and performance –  user973254 Nov 8 '13 at 20:23
    
Unfortunately the server only has 8 GB ram and i assume MySQL needs like 20 GB to complete the alter table process. –  bitrocker Nov 9 '13 at 21:20

1 Answer 1

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.
share|improve this answer
    
I just mentioned InnoDB in the tags, sorry. There are no tmp files, it's just InnoDB's ibdata file that now is 40 GB. –  bitrocker Nov 9 '13 at 21:22
    
Ok in that case a usefull link for you: stackoverflow.com/questions/3456159/… –  Veniamin Nov 10 '13 at 7:36

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.