Tuesday, 19 January 2016

Disk space usage reported differently by df and du [Linux]

What:

Linux

Problem:

While checking space on the server, df shows that there is no space left on /var partition, but if you run "du -hs /var/* | sort -h" it only shows 1GB as occupied space.

Solution:

Run
lsof -n | grep -i deleted
 In Linux, a file deletion simply unlinks the file. It actually gets deleted when there's no file handles connected to that file anymore, so you will have to restart daemon or send HUP signal to free up some space.

In my case I had apache logs waiting for deletion, which I resolved by gracefully restarting daemon.
apachectl graceful



Source: 1

No comments:

Post a Comment