Freen up soma hdd space on CPanel?

labahost

Well-Known Member
May 4, 2004
56
0
156
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?
 

WebScHoLaR

Well-Known Member
Dec 14, 2005
508
3
168
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.
 

labahost

Well-Known Member
May 4, 2004
56
0
156
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
 

WebScHoLaR

Well-Known Member
Dec 14, 2005
508
3
168
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...
 

labahost

Well-Known Member
May 4, 2004
56
0
156
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...
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?
 

sehh

Well-Known Member
Feb 11, 2006
579
6
168
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.
 

cPanelDavidG

Technical Product Specialist
Nov 29, 2006
11,212
13
313
Houston, TX
cPanel Access Level
Root Administrator
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.
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?
 

sehh

Well-Known Member
Feb 11, 2006
579
6
168
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...
 

labahost

Well-Known Member
May 4, 2004
56
0
156
It seems that /home/virtfs take about 22Gb of space, is there anything I can do with it?
 

sehh

Well-Known Member
Feb 11, 2006
579
6
168
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
 

labahost

Well-Known Member
May 4, 2004
56
0
156
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
But is it reported to the system 2 times or just once?
 

sehh

Well-Known Member
Feb 11, 2006
579
6
168
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.