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.
This entry was posted by Pieter Vogelaar on March 21, 2012 at 15:22, and is filed under Ubuntu. Follow any responses to this post through RSS 2.0.You can leave a response or trackback from your own site.
Comment Feed for this Post
- 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
About Pieter Vogelaar (60 posts)
Hi, my name is Pieter Vogelaar. I’m a web developer / DevOps engineer / IT consultant and specialized in high traffic and high profile websites. I love open source and have a great passion for automating and developing things!