1837835 Members
2373 Online
110121 Solutions
New Discussion

Re: /var 100%

 
SOLVED
Go to solution
Ali Imran Abbas
Regular Advisor

/var 100%

My /var filesystem shows 100%.

I have deleted some mail files for root and oracle in /var/mail but still its showing 100%.

/dev/vg00/lvol4 2002251 1805719 0 100% /var

I have also a question about /var/adm/diag directory, it got log files, can we delete them safely? What this folder is all about?

What are the other places in /var to delete?
7 REPLIES 7
Tim Nelson
Honored Contributor
Solution

Re: /var 100%

post the output from the below.

cd /var

du -sk *


Places to look.

/var/tmp
/var/preserve
/var/mail
/var/spool/lp/queuename (old print files, can also use lpstat -o )
/var/adm/sw/SAVE ( use cleanup command )
/var/adm/wtmp and btmp


If you use glance then you can move your data collection files either to a different filesystem and replace the /var/opt/perf/datafiles with a link to new FS (stop collectors first with mwa stop).

Ali Imran Abbas
Regular Advisor

Re: /var 100%

What does /var/adm/diag contains because it has whole lot of log files:

rwxr-xr-x 1 root root 995368 Jun 26 13:54 LOG0581
-rwxr-xr-x 1 root root 995368 Jun 26 14:35 LOG0582
-rwxr-xr-x 1 root root 995368 Jun 26 15:15 LOG0583
-rwxr-xr-x 1 root root 995368 Jun 26 16:09 LOG0584
-rwxr-xr-x 1 root root 995368 Jun 26 16:51 LOG0585
-rwxr-xr-x 1 root root 995368 Jun 26 17:35 LOG0586
-rwxr-xr-x 1 root root 995368 Jun 26 18:21 LOG0587
-rwxr-xr-x 1 root root 995368 Jun 26 19:04 LOG0588
-rwxr-xr-x 1 root root 995368 Jun 26 19:43 LOG0589
-rwxr-xr-x 1 root root 995368 Jun 26 20:28 LOG0590
-rwxr-xr-x 1 root root 995368 Jun 26 21:09 LOG0591
-rwxr-xr-x 1 root root 995368 Jun 26 21:51 LOG0592
-rwxr-xr-x 1 root root 995368 Jun 26 22:39 LOG0593
-rwxr-xr-x 1 root root 995368 Jun 26 23:22 LOG0594
-rwxr-xr-x 1 root root 995368 Jun 27 00:05 LOG0595
Grayh
Trusted Contributor

Re: /var 100%

when files that are in use are deleted , the space it occupied still remaines "in use".
did you remove (log)files under /var ?

if yes , thy to find out which processes were connected to the files. stop and restart these processes and space will have been free-ed.
-----
You can cleanup the follwing directories

/var/tmp
/var/adm/crash

Look for core files in /var

find /var -name core* -print
Cleanup also this files

/var/adm/diag/LOG*[diagnostic logs] can be deleted without any harm

Also anything in /lost+found can be rm'd as well.
Via SAM you can trim log files:

/var/adm/btmp
/var/adm/sulog
/var/adm/wtmp
/var/adm/cron/log (and OLDlog)
/var/adm/lp/log
/var/adm/syslog/maillog
/var/adm/syslog/syslog.log

#rm -f /var/preserve/*

SKR_1
Trusted Contributor

Re: /var 100%

Hi

1.You can gzip sar output files inside /var/adm/sa

2.Trim syslog.log inside /var/adm/syslog

Command to run
# > syslog.log

3. Can delete old crash directories inside

/var/adm/crash ( Note- be sure /var/adm/crash is not mounted as separate FS.

4. Can trim the mail.logs for different users. ( such as root, oracle etc.)


Thanks

SKR
Pete Randall
Outstanding Contributor

Re: /var 100%

You can run the cleanup command to get rid of superceded patches in /var/adm/sw/save.

cleanup -c 1

will cleanup patches that have been superceded once.

cleanup -c 2

will get rid of those superceded twice


Pete

Pete
Sajjad Sahir
Honored Contributor

Re: /var 100%



Der Ali imran
u have to trim log files regularly.

for trimming u can use > symbol
eg :
>sulog

ok second thing check any directory or files taking more space

if unnessery file is there remove it

if u are seeing any core file u can easily remove it
find /var -name core -exec rm -i ll {}\;
etc..
thanks and regards
Sajjad
Bill Hassell
Honored Contributor

Re: /var 100%

The diag logfiles are too small to be of any concern (1 meg each). You need to find where the biggest amount of space is being used. Run this command:

du -kx /var | sort -rn | head -20

Then look in the largest directories. This command will sort the files by size:

ll /var/some_dir | sort -rnk5 | head -20


Bill Hassell, sysadmin