LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   /var is at 100% usage, even after deleting files (https://www.linuxquestions.org/questions/slackware-14/var-is-at-100-usage-even-after-deleting-files-481690/)

WindowBreaker 09-08-2006 04:25 PM

/var is at 100% usage, even after deleting files
 
I had a problem where log files grew very big on /var. My usage was at 100% per 'df -h'. I removed all the big log files, but it's still showing as 100% usage. If I run 'du -sh /var' , it's only 600MB now, but it's showing as 6.5GB on the output of the 'df -h' command. It's mounted as it's own partition.

I need it to realize only 600MB are being used without actually remounting the /var partition, since people are using the server. Until I do this, postfix SMTP will not receive emails, saying there's not space left on device.

Any help would be appreciated.

Tinkster 09-08-2006 04:53 PM

Well, if you've deleted a file while it's still in use you've created
a harder to diagnose problem ... the file (and it's allocated inodes)
will remain in use until you shut down the service/process that had
created it.

In other words ... remember what you killed, which process owned it,
and then HUP that process.


Cheers,
Tink

WindowBreaker 09-08-2006 05:05 PM

Tinkster:
Thanks for the tip. The log files I deleted were from several days ago, and I made sure they were not being accessed.

The solution was, as I suspected, to unmount/remount the /var partition. I just warned my users, and rebooted. Now the output of 'df -h' shows the correct usage.

It still bugs me that it took a remount to update the output.

Tinkster 09-08-2006 05:12 PM

A reboot shouldn't have been necessary if the umount actually worked.
If it didn't it indicates that some process was still holding on to
some files.


Cheers,
Tink

Daga 09-08-2006 06:47 PM

Next time "lsof|grep '/var/path/log_file'" might help diagnose which program is responsible :)

unSpawn 09-08-2006 07:06 PM

"lsof|grep '/var/path/log_file'"
Use "lsof +D /var/log" and get one command to use elsewhere for free!!!
That's amazing, Mike.

tobyl 09-10-2006 08:17 AM

have you got logrotate running?
you can add your own logfiles if you need to, in /etc/logrotate.conf

tobyl


All times are GMT -5. The time now is 09:37 PM.