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.

Freen up soma hdd space on CPanel?

Discussion in 'General Discussion' started by labahost, Nov 21, 2007.

  1. labahost

    labahost Well-Known Member

    Joined:
    May 4, 2004
    Messages:
    56
    Likes Received:
    0
    Trophy Points:
    6
    Currently we have an old CPanel server with 60Gb hdd, it shows more than 90% disk ussage but listaccts show only about 13Gb are actually used by user accounts, backup is done on another disk. Is there a way to free up some space on this server?
     
  2. WebScHoLaR

    WebScHoLaR Well-Known Member

    Joined:
    Dec 14, 2005
    Messages:
    511
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Planet Earth
    Run the command "df -h" on the server and paste the output here. Space can be made free but I would suggest that you take help from someone who knows that what to delete and what not to delete.
     
  3. labahost

    labahost Well-Known Member

    Joined:
    May 4, 2004
    Messages:
    56
    Likes Received:
    0
    Trophy Points:
    6
    here is the result df -h

    Filesystem Size Used Avail Use% Mounted on
    /dev/hda5 53G 47G 2.9G 95% /
    /dev/hda1 99M 8.4M 86M 9% /boot
    /dev/hda3 1012M 35M 926M 4% /tmp
    none 502M 0 502M 0% /dev/shm
    /tmp 1012M 35M 926M 4% /var/tmp
     
  4. WebScHoLaR

    WebScHoLaR Well-Known Member

    Joined:
    Dec 14, 2005
    Messages:
    511
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Planet Earth
    Alright then this is how you should proceed:

    du -ah --max-depth=1 /

    It will show you the disk usage for all directories at / partition. So cd into the folder that is consuming the maximum space and run du -ah --max-depth=1 sitting there and so on...
     
  5. labahost

    labahost Well-Known Member

    Joined:
    May 4, 2004
    Messages:
    56
    Likes Received:
    0
    Trophy Points:
    6
    But are there any common cases of what can consume so much space? And what is safe to delete and what not, is there any FAQ on it?
     
  6. sehh

    sehh Well-Known Member

    Joined:
    Feb 11, 2006
    Messages:
    579
    Likes Received:
    5
    Trophy Points:
    18
    Location:
    Europe
    Some time ago i opened a thread about this issue.

    cPanel has a major bug, or at least a problem that nobody is willing to fix, even though we've opened a bug report.

    basically, after a few months or a year, your server will consume all its disk space because cPanel doesn't clean up after itself.

    Here are a few things we found:

    1) /etc/httpd/logs, some logs like the "suexec_log" are not rotated. Also, some /etc/httpd/domlogs/*ssl* are also not rotated. We've added a bunch of lines in logrotate to fix that.

    2) /home/.cpan and /home/.cpcpan, those will consume GIGs or terabytes with garbage and old data files. We've added a bunch of cron jobs to delete both directories once a week.

    Other popular directories with trash, include /usr/local/cpanel/3rdparty, but i can't be sure what you can delete from there.

    So far cPanel developers have been ignoring this and refuse to make their update script clean up after it self, that should have solved the problems in /home/.cpan.
     
  7. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Note that log rotation is built into cpanellogd and suexec log rotation was introduced in recent builds. Is cpanellogd running on your server? If not, that can lead to logs filling up the hard drive, and if the logs get over 2 GB in size, software (most notably, Apache) can begin malfunctioning.

    What is the bugzilla ID number?
     
  8. sehh

    sehh Well-Known Member

    Joined:
    Feb 11, 2006
    Messages:
    579
    Likes Received:
    5
    Trophy Points:
    18
    Location:
    Europe
    Yes its running, but that never helped:
    29787 ? SN 0:13 cpanellogd - sleeping for logs

    I've opened loads of bugzilla reports, one of them is about stale files:
    5805, 5935, 5942, 6030, 6049, etc...
     
  9. labahost

    labahost Well-Known Member

    Joined:
    May 4, 2004
    Messages:
    56
    Likes Received:
    0
    Trophy Points:
    6
    It seems that /home/virtfs take about 22Gb of space, is there anything I can do with it?
     
  10. sehh

    sehh Well-Known Member

    Joined:
    Feb 11, 2006
    Messages:
    579
    Likes Received:
    5
    Trophy Points:
    18
    Location:
    Europe
    I believe /home/virtfs is a hardlink, so it doesn't take any extra space, it should only report the space already being used by the stuff it links to.

    or am i completely wrong? :P
     
  11. labahost

    labahost Well-Known Member

    Joined:
    May 4, 2004
    Messages:
    56
    Likes Received:
    0
    Trophy Points:
    6
    But is it reported to the system 2 times or just once?
     
  12. sehh

    sehh Well-Known Member

    Joined:
    Feb 11, 2006
    Messages:
    579
    Likes Received:
    5
    Trophy Points:
    18
    Location:
    Europe
    i don't know really, if cPanel is counting the used space of hardlinks then thats a bug. i sure hope they aren't doing that.

    one thing is for sure, the "du" command does NOT count them twice, unless you specify the "--count-links" parameter.
     

Share This Page