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?
- 907
4 Answers
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.
- 4,265
- 25
- 15
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.
- 12,479
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).
- 9,523
Also check your .trash directory.
- 2,904
- 18
- 26
-
-
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
sudo kill -HUP 12345may 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.) – Mark E. Haase Sep 18 '12 at 18:56lsof +L1to see the deleted-but-open files – törzsmókus Jun 14 '23 at 15:06