1834478 Members
3520 Online
110067 Solutions
New Discussion

Re: var directory

 
John Curtis
Occasional Advisor

var directory

My var directory has become almost full. What can I simply remove or relocate to free up space?
7 REPLIES 7
Andrew_4
Honored Contributor

Re: var directory

* Check your /var/adm/crash directory... you can remove all in here (unless your interested in analysing any crash information !)

* the command 'cleanup' will remove the files/binaries for old patches, but you should make sure your machine is stable before running this command as you will no longer be able to roll back patches.

* Any core files - # find /var -name core

* mail for root


hope this helps !

Andrew

The Unix Programmer's Manual, 2nd Edition, June, 1972: "The number of Unix installations has grown to 10, with more expected."
Eileen Millen
Trusted Contributor

Re: var directory

check /var/tmp for any large temporary files that could be removed.
You could also trim some of the log files with SAM. /var/adm has some log files.
Mark Mitchell
Trusted Contributor

Re: var directory

Also, in var/adm there is the wtmp file that can be trunicated.
> wtmp
Philip Chan_1
Respected Contributor

Re: var directory

John,

First thing you should do is to identify which directory (or directories) under /var are taking up the space.

Just do,

cd /var
du -s *

repeat the above steps you'll see all how these disk space were being used up, then decide what to do with it.

Right out of my mind, check /var/adm/sw/save (du -s /var/adm/sw/save). This dir usually took up a lots of disk space if your system has uncommited patches.

Rgds,
Philip
Bill Hassell
Honored Contributor

Re: var directory

To second the searching for big directories (not files), here is a shortcut:

du -kx /var | sort -rn > /tmp/du.var

Now look at the /tmp/du.var file to see what directories are at the top of the list. Then look inside to see what is occupying so much space.

Resist the temptation to just remove big files. If they are log files, look at the contents to see if anything important is there, then zero the file length rather than removing the file. Other locations with big directories:

/var/spool
/var/adm
/var/adm/sw
/var/adm/crash
/var/mail

Use this command to sort files into size order:

ls -l | sort -nrk 5 | more


Bill Hassell, sysadmin
Carlos Fernandez Riera
Honored Contributor

Re: var directory

My procedure:

find /var -xdev -type f -mtime -10 -size +1000000c

## Find in /var filesystem files modified last 10 days and greater than 1M.

Also list :

/var/preserve
/var/adm/crash
/var/tmp
/var/adm/syslog


unsupported
Vincenzo Restuccia
Honored Contributor

Re: var directory

Check in /var/adm/crash.