Command “df” in linux shows incorrect free space after file removal
Today the “/tmp” directory was full on a server because of a huge log file. When I checked it with the command “df -h” is saw that the directory used 100% of disk space. After I removed the log file, “df -h” still displayed the same value. I thought that it might be a caching problem, but the fact is that deleting a file name doesn’t actually delete the file.
It is not visible anymore if you execute the command “ls -sal”, but if some other process is holding the file open, it is not really deleted.
To see which process is keeping the file open:
Now you know the process, you can kill or restart it and the file will be released and deleted.
- Ubuntu 12.04 – Install Gearman and GearmanManager
- Ubuntu 14.04 – Install Selenium as service (headless)
- Ubuntu 12.04 – Install Postfix, Dovecot and Vimbadmin
- Ubuntu 12.04 – Install Solr 4 with Jetty 9
- Ubuntu 12.04 – Install Jetty 9
- Ubuntu 12.04 + Nginx 1.2.6 + PHP-FPM server block / vhost example
- Varnish 3 – Block ip addresses
- Ubuntu 12.04 – Install Varnish 3 in front of Apache 2
- Ubuntu 11.04 / OpenPanel – Install Webalizer
- Ubuntu 11.10 – Configure POEdit for Zend Framework