Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am having a disk space problem on the root partition, so I went through unimportant logs and deleted what could be deleted.

One of the files "mysql-slow.log" was 32GB big, but when I deleted it, it never freed a space on the disk. I use df -h command to check.

Root partition is formatted ext4.


share|improve this question
up vote 11 down vote accepted

In Linux/Unix world file deletion does not necessarily immediately free the disk space, it merely unlinks the file from file system.

If there are processes having file handles open to file being removed (as is common with syslog daemon, and in MySQL case, that mysql-slow.log), the space is not freed until the holding process is asked to reopen the file handles (HUP, hangup signal), or the process is restarted.

If you don't know what process is actually holding the file open, use lsof -n | grep filename or if you want to see what marked-as-deleted-but-still-in-use files are present in system, lsof -n | grep deleted

share|improve this answer

df should update after restarting mysqld service.

share|improve this answer

Your Answer


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.