Jan 212010

I recent came across an issue where the /tmp folder was being listed as 100% full

df -H | grep -vE '^Filesystem|tmpfs|cdrom'

/dev/sda7 2.1G 514M 1.5G 27% /
/dev/sda8 124G 2.5G 115G 3% /home
/dev/sdb1 156G 1.2G 146G 1% /backup
/dev/sda6 2.1G 2.1G 0M 100% /tmp < << /dev/sda5 11G 8.2G 1.8G 83% /var /dev/sda2 11G 4.5G 5.4G 46% /usr /dev/sda1 200M 19M 171M 10% /boot

Strangely, there were no files in the /tmp folder. This is how it happens. If you delete files from a folder and they still show up when you check a df -h disk status, then the deleted files are linked to currently running processes. You will have to stop or restart the processes that had those files open in the first place, typically httpd or mysql.

lsof | grep /tmp

will get the result shown below

httpd 30170 nobody 1975u REG 7,0 0 11 /tmp/ZCUDMogQDr (deleted)
httpd 30200 nobody 1975u REG 7,0 0 11 /tmp/ZCUDMngQDr (deleted)
mysqld 7291 mysql 5u REG 7,0 1089 29 /tmp/ibYfoGNC (deleted)
mysqld 7292 mysql 6u REG 7,0 0 30 /tmp/ibgA0zfB (deleted)

You will need to kill the httpd and mysql processes it shows that are linked to the deleted files which will fix the problem.

To kill the httpd and mysql processes

killall -e -9 httpd

service httpd restart

 Posted by at 3:32 am