The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Drive Warning: /dev/sda3 (/usr) is 91% full need some help optimizing

Discussion in 'Workarounds and Optimization' started by benniblanco, Jan 21, 2013.

  1. benniblanco

    benniblanco Member

    Joined:
    Jan 21, 2013
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    I have read all posts about this issue but for some reason my sda3 drive size is not coming down ,

    this is the current listed size

    usr/local/cpanel$ df -h
    Filesystem Size Used Avail Use% Mounted on
    /dev/sda5 9.7G 741M 8.5G 8% /
    /dev/sda7 195G 60G 126G 33% /home
    /dev/sda3 9.7G 8.4G 859M 91% /usr
    /dev/sda2 9.7G 2.8G 6.5G 31% /var
    /dev/sda1 99M 24M 71M 25% /boot
    none 7.9G 0 7.9G 0% /dev/shm
    /dev/sdc1 227G 93G 134G 41% /home2
    /dev/sdb1 459G 22G 414G 5% /backup2
    /home2/tmpMnt 4.9G 12M 4.6G 1% /var/tmp

    now I listed all folders and their sizes within usr dir and I came up with only 4.9GB instead 8.4GB as listed by df -h


    /usr$ du -h --max-depth=1
    218M ./bin
    12K ./etc
    112M ./sbin
    1.8M ./kerberos
    27M ./include
    888M ./share
    102M ./src
    8.0K ./games
    16K ./lost+found
    435M ./lib
    494M ./lib64
    128K ./man
    2.6G ./local
    21M ./libexec
    16K ./X11R6
    4.9G .


    2 days ago I moved domlogs to home/ instead usr and drive size went down to 84% but something keeps on piling up.

    I have awstats on 1 account only , logs are set to rotate but this is not coming down

    please advise.

    Thank you!
     
  2. benniblanco

    benniblanco Member

    Joined:
    Jan 21, 2013
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Softlayer recommends to run FSCK and I am very sceptic about since I have ready many posts where people edn up having trouble after the FSCK .
     
  3. cPanelJared

    cPanelJared Technical Analyst
    Staff Member

    Joined:
    Feb 25, 2010
    Messages:
    1,842
    Likes Received:
    18
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Your /usr is really too small to begin with. /usr is where most of the operating system binaries and cPanel binaries live. Generally, you can expect the operating system to use about 2 GB in /usr, and cPanel another 2 GB, so that is 4 GB used before you even start to install your own applications.

    I know this does not help right now, but on a new installation, it is really best to have a small /boot partition, a swap partition, and give the rest to /. There are valid reasons to want to put some directories on different partitions, but it is very difficult to guess ahead of time what the server's future needs might be, and much too easy to make one or more partitions too small. Putting everything on / avoids this problem.

    I know you mentioned "logs are set to rotate", but you did not specify which logs, so please forgive me if the following suggestions are redundant.

    One thing you can look for to reduce the size in /usr is the Apache logs and domlogs. In Home » Server Configuration » Tweak Settings, do you have Delete each domain’s access logs after stats run set to On? If not, you may have some very large domlogs.

    In Home » Service Configuration » Apache Configuration » Log Rotation, do you have all of the logs set to be rotated? If not, you may have some very large Apache logs.

    If log rotation is not already enabled, simply enabling it for all of the Apache logs, and setting the domlogs to be deleted after each stats run, may fix the problem, as the server's normal log rotation processes run. These normally run very late at night, so you will probably need to wait a day to see any effect.

    Lastly, make sure that rotation is enabled for the cPanel logs in Home » Service Configuration » cPanel Log Rotation Configuration

    All of the logs I have mentioned are located in /usr, and if they have grown to be very large, they will exacerbate the problem of a /usr partition that is really too small. However, a large part of the problem is simply that /usr is where many applications and services live, and its usage can be expected to be significant on most servers.

    If you recently deleted a large number of files, there are cases where you do not see the free disk space until you reboot the server. Yes, an fsck does carry some risk, but only if there is already filesystem corruption. In other words, the risk from fsck comes from the process of fixing damage that already exists, not that fsck will cause new damage. If it has been a long time since an fsck has been run on the partition, an fsck will probably be forced on server boot, so there may be no way to avoid this. Make sure you have backups of your data, store those backups somewhere else, and verify the integrity of the backups, before you proceed.
     
  4. benniblanco

    benniblanco Member

    Joined:
    Jan 21, 2013
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Thank you much for replying logs info
    /http://prntscr.com/q10fj

    all rotating
    Delete each domain’s access logs after stats run is set to ON

    cPanel log rotation
    /http://prntscr.com/q10l0

    you say my partition is to small , I have 9.7GB , and 2 days ago I moved the domlogs which were causing the biggest files sizes to home dir
    see

    domlogs moved
    /http://prntscr.com/q10tn
    original destination linked
    /http://prntscr.com/q10wq

    all that leaves me really with 4.9GB usr folder size which should be more than enough
    I ran some stats of file sizes in there and there are no large files so I think you might be right about the reboot

    so would you recommend reboot only ,

    or reboot , check if size is fixed , if not do FSCK ?
     
  5. benniblanco

    benniblanco Member

    Joined:
    Jan 21, 2013
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    server reboot fixed the drive size issue!
     
  6. cPanelJared

    cPanelJared Technical Analyst
    Staff Member

    Joined:
    Feb 25, 2010
    Messages:
    1,842
    Likes Received:
    18
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    A reboot is sometimes worth a try, after deleting a large amount of files. If it has not been done recently, it would be good to go ahead and run an fsck with the server offline (never run fsck on a mounted filesystem). It is best to run filesystem checks as part of a routine maintenance program and you do not suspect filesystem corruption, not just when an emergency happens and the filesystem is corrupt as to be unbootable.
     
Loading...

Share This Page