Wednesday, September 12, 2012

What is taking up all this space?

We had a filesystem that kept growing in size even though the user was deleting the log files. du and df didn't match up and it was starting to be a problem. We restarted one of the apps and got back a little space so I figured there were still open file handles holding on to the space. 

>>lsof | grep deleted

 That showed me the app that was holding on to the space.

>>lsof | grep deleted | awk '{print $1, $2, $7, $9}'

 Then on the PID of the app I ran:

 >>kill -HUP 8787

 Presto, that freed up all the disk space.