Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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 deleted a 2.3GB log file on my Ubuntu server, and df doesn't seem to be picking up the change. Is there typically a delay before df can detect that a large file has been deleted?

share|improve this question
up vote 13 down vote accepted

It sounds like the file is still open by some process. You'll need to restart that service for the disk space to be freed.

share|improve this answer
Particularly likely to be true for log files. Many programs open their log filse when they start and don't close them until exit. – mattdm Feb 1 '11 at 4:19
And you can find out if it's still in use and by whom using lsof – Joris Feb 1 '11 at 6:00
Great question and great answer. I've been wondering this for some time now. Also, you may be able to get it to close its file handle by sending it a SIGHUP. For example, if process 12345 has a "deleted" file open, then sudo kill -HUP 12345 may get that process to close it. (It depends, of course, on how that process handles a SIGHUP signal. But lots of daemon oriented files will close and reopen file handles when they receive a SIGHUP.) – mehaase Sep 18 '12 at 18:56
I thought we cannot delete opened files ! – Ashish Karpe Nov 10 '15 at 13:19
In my case i got 18Gb logs in /var/log/apache2 I couldn't retrieve my free space until .. stopped apache :) I restarted apache and my free space returned. – user324197 Nov 25 '15 at 20:37

If the filesystem was out of space you could be running into the reserved space on the filesystem. The ext2/3/4 filesystems have some reserved space set aside for root. By default this is 5%. So if it was full and 2.3GB is less than 5% of the space on the drive the filesystem will still appear to be full.

In this situation you have two choices. To continue to free up space to the point that you have usable free space or modify the amount of space the filesystem has reserved. To modify the amount of reserved space use the tune2fs -m 0 /dev/sda1 replacing the 0 with the percentage of reserved space you wish to have and /dev/sda1 with the appropriate device.

See the accepted answer to this question for more details.

share|improve this answer

Not long. Chances are high that the file is simply still being used. There won't be disk space release till you terminate corresponding process(es).

share|improve this answer

Also check your .trash directory.

share|improve this answer
where is this .trash directory ? – Ashish Karpe Nov 10 '15 at 13:17
On ubuntu 14.04 I see I have a ~/.local/share/Trash, which is full of junk I've deleted in Nautilus. – Jonathan Hartley Dec 14 '15 at 17:30

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.