var disk space

Hello All,

I have been under a big problem, the /var directory suddenly reaches 100%, when i check into it i find bandwidth file which consumes over 9GB…I then delete it but yet the file system is 100% full, due to this i am unable to restart the mysql or apache.

[root@life var]# pwd
/var
[root@life var]# du -sh
233M .
[root@life var]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda6 9.5G 1.7G 7.4G 19% /
/dev/sda1 99M 12M 83M 13% /boot
tmpfs 1.5G 0 1.5G 0% /dev/shm
/dev/sda5 9.5G 3.3G 5.8G 37% /usr
/dev/sda2 12G 12G 12G 100% /var
/dev/sda9 4.6G 138M 4.3G 4% /tmp
/dev/sda10 14G 6.0G 7.1G 46% /Daily_backup
/dev/sdc 1.5T 677G 726G 49% /srv/music

Any idea on how to fix this.

Are you sure it is bandwidth file and not this bug…
https://bugzilla.novell.com/show_bug.cgi?id=469872

I have these file under var and /var/log

[root@life var]# ls
account cache cvs empty games lib lock mail net-snmp opt racoon spool tux www
asif crash db ftp gdm local log named nis preserve run tmp webmin yp

[root@life log]# ls
acpid anaconda.xlog conman dmesg lastlog mysqld.log samba snmpd.log vbox
anaconda.log audit conman.old faillog mail ppp scrollkeeper.log spooler wtmp
anaconda.syslog boot.log cron gdm maillog prelink secure squid xferlog
anaconda.syslog.bk btmp cups httpd messages rpmpkgs setroubleshoot tallylog yum.log

what do i think, is that the bandwidth file gets delted but yet the df -h shows the file system is 100% full.
Please help me fix this issue.

If you’re really sure that du is showing you have space with something like in /var maybe even /var/log
du -kxm / | sort -r -n | more

Then that would leave a process still using a file deleted as here… Linux ext3 FAQ

Which would mean investigating with lsof and finding the process that has hold of the deleted file…

Dear FetherMonkey,

This is the output to my query to system

[root@life log]# du -kxm / | sort -r -n | grep /var
1 /var

Any further help!

Not really that just shows the top directory we need to see what is using it under /var and confirm it is or isn’t in /log…

I also said like, it needed tweaking but not with the grep…

Try this
lsof | grep /var/log

Do you see the file you deleted? If so you need to kill the process that owns it… But if syslog don’t needs googling not sure you can or what effect it’ll have.

If lsof doesn’t show it
du -sm /var
you can look up the flags but if I got that correct its summary on /var in mb. So if the mb is close to df 100% then you need to continue and modify the original command as it is one filesytem that being / why only 1mb for /var

man du

I used your command

lsof | grep /var/log

and came to know that the /var/log/bandwidth was deleted, but the process was yet going from syslog. So i went into syslog and found that this was in there, i deleted /var/log/bandwidth from syslog config and restarted the syslog and there is no more tensions now.
Your help really solved my problem.

Glad we got you solved. :wink:

I wasn’t sure what closing syslog down would do but seems it was fine…