#1 (permalink)  
Old 05-04-2009, 04:43 AM
Registered User
 
Join Date: May 2007
Posts: 17
bgqs is on a distinguished road
Drive Warning: /dev/sda3 (/var) is 82% full !!!

Hi,

/var is 82% full on my server. The majority of this space is being taken by the /tmp directory.

One question, am I okay to delete the contents of the /tmp directory without affecting any of the server's processes etc?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 05-04-2009, 04:58 AM
Registered User
 
Join Date: May 2007
Posts: 17
bgqs is on a distinguished road
More research:

df -h

Code:
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda6             2.0G  242M  1.7G  13% /
/dev/sda1              99M   12M   83M  12% /boot
none                  504M     0  504M   0% /dev/shm
/dev/sda8             130G  6.0G  118G   5% /home
/dev/sda7             494M   11M  458M   3% /tmp
/dev/sda2             9.9G  4.0G  5.4G  43% /usr
/dev/sda3             2.5G  1.9G  424M  82% /var
/tmp                  494M   11M  458M   3% /var/tmp
du -h --max-depth=1 /var

Code:
8.0K    /var/local
76M     /var/spool
192K    /var/named
772K    /var/run
16K     /var/crash
731K    /var/tmp
24K     /var/empty
8.0K    /var/preserve
161M    /var/cpanel
28K     /var/db
8.0K    /var/opt
684M    /var/lib
84K     /var/profiles
24K     /var/yp
855M    /var/cache
12K     /var/portsentry
103M    /var/log
1.2M    /var/www
8.0K    /var/nis
12K     /var/account
36K     /var/lock
16K     /var/lost+found
1.9G    /var
du -ah --max-depth=1 /var/cache

Code:
853M    /var/cache/yum
16K     /var/cache/samba
4.0K    /var/cache/mod_ssl
4.0K    /var/cache/mod_proxy
1.9M    /var/cache/man
855M    /var/cache

1st Problem is in Yum.


du -ah --max-depth=1 /var/cache/yum

Code:
568K    /var/cache/yum/extras
0       /var/cache/yum/.gpgkeyschecked.yum
266M    /var/cache/yum/update
40K     /var/cache/yum/addons
587M    /var/cache/yum/base
853M    /var/cache/yum
du -ah --max-depth=1 /var/cache/yum

Code:
561M    /var/cache/yum/base/packages
21M     /var/cache/yum/base/headers
612K    /var/cache/yum/base/primary.xml.gz
4.9M    /var/cache/yum/base/primary.xml.gz.sqlite
0       /var/cache/yum/base/cachecookie
4.0K    /var/cache/yum/base/repomd.xml
587M    /var/cache/yum/base
The problem is in /yum/packages....can I delete this ?


2nd problem


[b]du -ah --max-depth=1 /var/lib

Code:
8.0K    /var/lib/pcmcia
4.7M    /var/lib/slocate
8.0K    /var/lib/games
12K     /var/lib/dhcp
4.0K    /var/lib/random-seed
12K     /var/lib/alternatives
8.0K    /var/lib/up2date
8.0K    /var/lib/php
23M     /var/lib/rpm
28K     /var/lib/nfs
8.0K    /var/lib/logrotate.status
8.0K    /var/lib/dhcpv6
656M    /var/lib/mysql
272K    /var/lib/spamassassin
16K     /var/lib/misc
4.0K    /var/lib/dav
4.0K    /var/lib/supportinfo
684M    /var/lib
2nd Problem is in MySQL

Remedy: I have checked the databases and will remove db's that are no longer in use.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 05-04-2009, 10:15 AM
cPanel Partner NOC
cPanel Partner NOC Badge
 
Join Date: Jul 2005
Location: New Jersey, USA
Posts: 387
PlatinumServerM is on a distinguished road
The most common places where space is used on var is /var/log and /var/lib/mysql and /var/spool/exim

Clear up the old logs, mail queue, and any unneeded mysql databases.

If necessary, mysql can be moved to another drive or partition.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 05-05-2009, 04:44 AM
Registered User
 
Join Date: May 2007
Posts: 17
bgqs is on a distinguished road
Thanks...logs is only using 103mb !

The main one is /var/cache/yum/base/packages which is over 500mb. Can I delete the contents of this folder ?

I have deleted old db's and have saved 5% !

Obviously 500mb of a 1.9gb partition is a lot....I could do with reducing the content of the yum folder if possible....

Please help me
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 05-05-2009, 02:00 PM
Registered User
 
Join Date: Jan 2005
Posts: 25
theBassTender is on a distinguished road
run the following as root:

yum clean all

this will clean the yum caches and headers
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 05-05-2009, 02:18 PM
Registered User
 
Join Date: May 2007
Posts: 17
bgqs is on a distinguished road
Nice one....that has reduced the size of /var to 40%

Thanks mate
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 05-13-2009, 11:24 PM
Registered User
 
Join Date: Aug 2004
Posts: 149
screege is on a distinguished road
well I have the following under log:

-rw-r----- 1 root root 5288 May 8 06:10 acpid
drwxr-x--- 2 root root 4096 May 10 09:32 audit
drwxr-xr-x 3 root root 4096 Jan 3 00:00 bandwidth
-rw------- 1 root root 1375 Apr 1 09:23 boot.log
-rw------- 1 root utmp 3072 Apr 29 16:56 btmp
-rw-r--r-- 1 root root 25567215 May 13 23:14 chkservd.log
drwxr-xr-x 2 root root 4096 Jan 12 09:58 conman
-rw-r--r-- 1 root root 342 Apr 20 22:57 cpupdate.env
-rw------- 1 root root 11366287 May 13 23:15 cron
drwxr-xr-x 2 lp sys 4096 Apr 17 18:55 cups
drwx------ 10 root root 4096 May 13 23:15 dcpumon
-rw-r--r-- 1 root root 20433 May 8 06:09 dmesg
-rw-r----- 1 mailnull mail 1325736768 May 13 23:16 exim_mainlog
-rw-r----- 1 mailnull mail 344 Apr 2 00:52 exim_paniclog
-rw-r----- 1 mailnull mail 593460677 May 13 23:16 exim_rejectlog
-rw------- 1 root root 12480 Apr 29 21:22 faillog
-rw-r--r-- 1 root root 9364440 May 13 23:13 lastlog
-rw------- 1 root root 1100656 May 13 23:13 lfd.log
-rw------- 1 root root 988220007 May 13 23:16 maillog
-rw------- 1 root root 49891594 May 13 23:13 messages
drwxr-xr-x 2 root root 4096 Apr 2 00:56 pm
drwx------ 2 root root 4096 Jan 20 22:27 ppp
drwxr-xr-x 2 root root 4096 Apr 2 04:07 prelink
-rw------- 1 root root 76353 May 13 04:07 rkhunter.log
-rw------- 1 root root 5039 May 13 04:07 rkhunter.log.old
-rw-r--r-- 1 root root 20538 May 13 04:07 rpmpkgs
drwxr-xr-x 2 root root 4096 May 13 00:00 sa
-rw------- 1 root root 45976548 May 13 22:57 secure
-rw------- 1 root root 0 Jan 2 01:10 spooler
drwxr-x--- 2 squid squid 4096 Jan 20 22:15 squid
-rw------- 1 root root 0 Apr 2 00:51 tallylog
-rw-rw-r-- 1 root utmp 367488 May 13 23:13 wtmp
lrwxrwxrwx 1 root root 41 Mar 25 00:50 xferlog -> ../../usr/local/apache/domlogs/ftpxferlog
-rw-r--r-- 1 root root 2 May 13 00:50 xferlog.offset
-rw-r--r-- 1 root root 1 Mar 25 00:42 xferlog.offsetftpsep
-rw-r--r-- 1 root root 14020 May 8 00:50 yum.log

which can I delete? And will they be recreated?

thanks
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 05-14-2009, 01:06 AM
cPanel Partner NOC
cPanel Partner NOC Badge
 
Join Date: Apr 2008
Location: PK
Posts: 232
JPC-Howard is on a distinguished road
Quote:
Originally Posted by screege View Post
well I have the following under log:

-rw-r----- 1 root root 5288 May 8 06:10 acpid
drwxr-x--- 2 root root 4096 May 10 09:32 audit
drwxr-xr-x 3 root root 4096 Jan 3 00:00 bandwidth
-rw------- 1 root root 1375 Apr 1 09:23 boot.log
-rw------- 1 root utmp 3072 Apr 29 16:56 btmp
-rw-r--r-- 1 root root 25567215 May 13 23:14 chkservd.log
drwxr-xr-x 2 root root 4096 Jan 12 09:58 conman
-rw-r--r-- 1 root root 342 Apr 20 22:57 cpupdate.env
-rw------- 1 root root 11366287 May 13 23:15 cron
drwxr-xr-x 2 lp sys 4096 Apr 17 18:55 cups
drwx------ 10 root root 4096 May 13 23:15 dcpumon
-rw-r--r-- 1 root root 20433 May 8 06:09 dmesg
-rw-r----- 1 mailnull mail 1325736768 May 13 23:16 exim_mainlog
-rw-r----- 1 mailnull mail 344 Apr 2 00:52 exim_paniclog
-rw-r----- 1 mailnull mail 593460677 May 13 23:16 exim_rejectlog
-rw------- 1 root root 12480 Apr 29 21:22 faillog
-rw-r--r-- 1 root root 9364440 May 13 23:13 lastlog
-rw------- 1 root root 1100656 May 13 23:13 lfd.log
-rw------- 1 root root 988220007 May 13 23:16 maillog
-rw------- 1 root root 49891594 May 13 23:13 messages
drwxr-xr-x 2 root root 4096 Apr 2 00:56 pm
drwx------ 2 root root 4096 Jan 20 22:27 ppp
drwxr-xr-x 2 root root 4096 Apr 2 04:07 prelink
-rw------- 1 root root 76353 May 13 04:07 rkhunter.log
-rw------- 1 root root 5039 May 13 04:07 rkhunter.log.old
-rw-r--r-- 1 root root 20538 May 13 04:07 rpmpkgs
drwxr-xr-x 2 root root 4096 May 13 00:00 sa
-rw------- 1 root root 45976548 May 13 22:57 secure
-rw------- 1 root root 0 Jan 2 01:10 spooler
drwxr-x--- 2 squid squid 4096 Jan 20 22:15 squid
-rw------- 1 root root 0 Apr 2 00:51 tallylog
-rw-rw-r-- 1 root utmp 367488 May 13 23:13 wtmp
lrwxrwxrwx 1 root root 41 Mar 25 00:50 xferlog -> ../../usr/local/apache/domlogs/ftpxferlog
-rw-r--r-- 1 root root 2 May 13 00:50 xferlog.offset
-rw-r--r-- 1 root root 1 Mar 25 00:42 xferlog.offsetftpsep
-rw-r--r-- 1 root root 14020 May 8 00:50 yum.log

which can I delete? And will they be recreated?

thanks
You do not need to delete the files, you can just empty them like this.

>exim_mainlog;>maillog;

and so on.
__________________
JaguarPC
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 05-14-2009, 08:36 AM
Registered User
 
Join Date: Aug 2004
Posts: 149
screege is on a distinguished road
thanks a lot, is there any script that can be done and that could be run via cron?

Thank you
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 03-01-2010, 01:37 PM
Registered User
 
Join Date: Oct 2004
Posts: 88
tangowebs is on a distinguished road
Hi, we moved the mysql dir to /home/mysql and seemed to be working fine til we tried to erase the dir /var/lib/mysq.

Now mysql webpages are not working and we have this error when trying to access:

MySQL Error!
------------------------

The Error returned was:
Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

Error Number:
1


Any idea about what can we do?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 12:15 PM.


Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
© cPanel Inc