Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Drive Warning: /dev/sda3 (/var) is 82% full !!!

Discussion in 'General Discussion' started by bgqs, May 4, 2009.

  1. bgqs

    bgqs Member

    Joined:
    May 24, 2007
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    151
    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?
     
  2. bgqs

    bgqs Member

    Joined:
    May 24, 2007
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    151
    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


    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.
     
  3. PlatinumServerM

    PlatinumServerM Well-Known Member
    PartnerNOC

    Joined:
    Jul 10, 2005
    Messages:
    400
    Likes Received:
    3
    Trophy Points:
    168
    Location:
    New Jersey, USA
    cPanel Access Level:
    Root Administrator
    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.
     
  4. bgqs

    bgqs Member

    Joined:
    May 24, 2007
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    151
    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 ;)
     
  5. theBassTender

    theBassTender Active Member

    Joined:
    Jan 2, 2005
    Messages:
    26
    Likes Received:
    1
    Trophy Points:
    153
    run the following as root:

    yum clean all

    this will clean the yum caches and headers
     
  6. bgqs

    bgqs Member

    Joined:
    May 24, 2007
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    151
    Nice one....that has reduced the size of /var to 40% ;)

    Thanks mate ;)
     
  7. screege

    screege Well-Known Member

    Joined:
    Aug 11, 2004
    Messages:
    190
    Likes Received:
    0
    Trophy Points:
    166
    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
     
  8. JawadArshad

    JawadArshad Well-Known Member
    PartnerNOC

    Joined:
    Apr 8, 2008
    Messages:
    458
    Likes Received:
    6
    Trophy Points:
    68
    Location:
    PK
    cPanel Access Level:
    DataCenter Provider
    You do not need to delete the files, you can just empty them like this.

    >exim_mainlog;>maillog;

    and so on.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  9. screege

    screege Well-Known Member

    Joined:
    Aug 11, 2004
    Messages:
    190
    Likes Received:
    0
    Trophy Points:
    166
    thanks a lot, is there any script that can be done and that could be run via cron?

    Thank you
     
  10. tangowebs

    tangowebs Well-Known Member

    Joined:
    Oct 12, 2004
    Messages:
    93
    Likes Received:
    0
    Trophy Points:
    156
    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?
     
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice