1758547 Members
1801 Online
108872 Solutions
New Discussion юеВ

/var usage

 
SOLVED
Go to solution
sgtmura
Occasional Advisor

/var usage

Hi,
I'm trying to find out what is filling up /var on my server.
du and df commands gives me contrasting information... and I cannot find what it is that is filling up the filesystem...

# du -sk /var
148 /var
# df -k /var
Filesystem kbytes used avail capacity Mounted on
/dev/dsk/c0d0s5 498271 445570 2874 100% /var

Thanks in advance for your help,
Rm
8 REPLIES 8
Jov
Honored Contributor

Re: /var usage

Hi,

I use a iterative process to track which file/directory are using up the space.

# du -sk /var/* | sort -rn | more

This will list the directory/file with the highest usage.


jov
RAC_1
Honored Contributor

Re: /var usage

following will list the dirs as per their space uasge in acesnding order.

du -kx /var | sort -n

Then check individual dirs to know more.
There is no substitute to HARDWORK
sgtmura
Occasional Advisor

Re: /var usage

Thanks Jov,

This is what I get from the command that you've given me. The sum is far less than what the df command is giving me... where is the rest of the space being used??

# du -sk /var/* | sort -rn | more
44 /var/spool
36 /var/dmi
22 /var/locale
14 /var/adm
10 /var/uucp
3 /var/preserve
2 /var/smtp-poplock
2 /var/lp
2 /var/log
2 /var/crash
1 /var/tmp
1 /var/ntp
1 /var/nis
1 /var/mail
1 /var/cron
RAC_1
Honored Contributor

Re: /var usage

Is /var still at 100%?? du did not show any of dirs with problem.

did you delete any file from var?? Looks like there was a file that was deleted, when process was still accessing it. In that case space will not be released till that process is stopped.
There is no substitute to HARDWORK
sgtmura
Occasional Advisor

Re: /var usage

Yes it's still at 100%. Is there a way to pin-point the process that is hanging on to the file?
RAC_1
Honored Contributor

Re: /var usage

Rm,
You missed something. I asked you you to
do du -kx /var|sort -nr

and not
du -sk

do du -kx /var | sort -rn and check dir that are occupying most of the space.
There is no substitute to HARDWORK
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: /var usage

You can run fuser or better still lsof to identify processes that are using files in /var. You have unlinked these files but until the files actually close or the process terminates, the space is not returned to the filesystem. Man 2 unlink for details.
If it ain't broke, I can fix that.
sgtmura
Occasional Advisor

Re: /var usage

Clay,
Found the culprit and restarted it. Which did the trick! Thank you very much!
And thanks to everyone else for giving me advise.
Regards,
Rm