LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-15-2011, 05:40 AM   #1
TheOnlyQ
Member
 
Registered: Apr 2011
Posts: 33

Rep: Reputation: 0
HELP! Diskspace :(


I have recently being struggling with an diskspace problem.

I run a i7 server in France and it is used as a production server (shared hosting)

Problem is that most space was allocated to /home/ of course for webhosting and only 10GB was allocated to /

Now the problem is that cPanel is freaking out because to put it basically, / is full.

/dev/root /var/named/chroot/var/run/dbus 95.11% (9661348 of 10157944)

I have 5TB on this thing but stupid me forgot to give / a little extra and I went along with the standard partition which only allocated 10GB.

I am wondering what I should do? I already moved the entire mysql database directory to /home/ and then did a symlink to save space, but that cleared 700mb and took it to 85%, WITHIN ONE DAY it went back up to 95% - there has to be something generating files and using all this space, if its logs then where should I look?

Sorry for all the questions, hope I can get an answer from one of you pro's - thanks.
 
Old 04-15-2011, 05:47 AM   #2
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295
Hello and Welcome to LinuxQuestions,

You could run this:
Code:
du -h / | grep ^[0-9.]*G
To find the directories that occupy the most diskspace and take it from there. Logs are normally found in /var/log so you could check which log (if any) is growing that rapidly. In that directory you should also have compressed older log files if your logrotate is setup correctly. If its logfiles that are consuming space then I'd look into which and why it/they are growing this fast and solve the problem. Next setup a decent logrotate plan limiting by size and deleting old logs after a short time or (even better if you need to keep them) move them using logrotate to another destination where you have space available.

Kind regards,

Eric
 
Old 04-15-2011, 05:49 AM   #3
TheOnlyQ
Member
 
Registered: Apr 2011
Posts: 33

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by EricTRA View Post
Hello and Welcome to LinuxQuestions,

You could run this:
Code:
du -h / | grep ^[0-9.]*G
To find the directories that occupy the most diskspace and take it from there. Logs are normally found in /var/log so you could check which log (if any) is growing that rapidly. In that directory you should also have compressed older log files if your logrotate is setup correctly. If its logfiles that are consuming space then I'd look into which and why it/they are growing this fast and solve the problem. Next setup a decent logrotate plan limiting by size and deleting old logs after a short time or (even better if you need to keep them) move them using logrotate to another destination where you have space available.

Kind regards,

Eric
Thanks for the fast reply - Would it be possible for me to delete ALL log files in /var/log/ without any issues?
 
Old 04-15-2011, 05:53 AM   #4
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295
Hi,

Most likely you'll encounter problems if you do so. All logs with an extension gz.X (X is a number) or just X (number) can be deleted without any problem since they are 'older' logs. The ones that have the normal .log extension I wouldn't delete. If one of them (or more) are big in size check why (look at the content), note the errors and solve them. If you need to reduce them you can do:
Code:
echo >/var/log/logfilename
Some processes freak out when you just delete the logfile if not setup correctly.

Kind regards,

Eric

Last edited by EricTRA; 04-15-2011 at 05:54 AM.
 
Old 04-15-2011, 05:59 AM   #5
TheOnlyQ
Member
 
Registered: Apr 2011
Posts: 33

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by EricTRA View Post
Hi,

Most likely you'll encounter problems if you do so. All logs with an extension gz.X (X is a number) or just X (number) can be deleted without any problem since they are 'older' logs. The ones that have the normal .log extension I wouldn't delete. If one of them (or more) are big in size check why (look at the content), note the errors and solve them. If you need to reduce them you can do:
Code:
echo >/var/log/logfilename
Some processes freak out when you just delete the logfile if not setup correctly.

Kind regards,

Eric
Understood - I just cleaned out a 1GB file named exim_mainlog which I understand is the mail-log file.

It instantly rose back to 1mb within a minute or so, thats pretty fast - is there anyway I can find out why this is growing so fastly?

Would it be safe to put /var/log/ in /home/log/ and then symlink /var/log/ to /home/log/ ?
 
Old 04-15-2011, 06:01 AM   #6
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,528

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
Deleting log files will just solve your problem for now.
You could create a script to delete the rotated log files, and put it in a cronjob.
If you have physical access to the server, an other option is to backup the
/home partition, and use gparted to shrink it.
Then you can create a separate partition for /var

Kind regards
 
Old 04-15-2011, 06:07 AM   #7
TheOnlyQ
Member
 
Registered: Apr 2011
Posts: 33

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by repo View Post
Deleting log files will just solve your problem for now.
You could create a script to delete the rotated log files, and put it in a cronjob.
If you have physical access to the server, an other option is to backup the
/home partition, and use gparted to shrink it.
Then you can create a separate partition for /var

Kind regards
I would love to do that but do not have physical access.
 
Old 04-15-2011, 06:11 AM   #8
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,528

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
Quote:
It instantly rose back to 1mb within a minute or so, thats pretty fast - is there anyway I can find out why this is growing so fastly?
A good start would be to look at the logs.
Do you have allot of mail traffic?
You can however set the log level lower
http://www.exim.org/exim-html-3.20/d...51.html#SEC862

Kind regards
 
Old 04-15-2011, 06:16 AM   #9
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,528

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
Quote:
Would it be safe to put /var/log/ in /home/log/ and then symlink /var/log/ to /home/log/ ?
Yes, but you need to reboot, in order to make it work.
Take a look at
http://serverfault.com/questions/559...-log-directory

Kind regards
 
Old 04-15-2011, 06:36 AM   #10
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295
Quote:
Originally Posted by repo View Post
Deleting log files will just solve your problem for now.
You could create a script to delete the rotated log files, and put it in a cronjob.
If you have physical access to the server, an other option is to backup the
/home partition, and use gparted to shrink it.
Then you can create a separate partition for /var

Kind regards
Hi,

No need to write a separate script for that. You can easily configure all you need in a logrotate config file. Have a look at the man page for logrotate:
Code:
man logrotate
more in particular the parameters rotate, size and olddir.

Kind regards,

Eric
 
Old 04-15-2011, 06:37 AM   #11
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295
Quote:
Originally Posted by TheOnlyQ View Post
Understood - I just cleaned out a 1GB file named exim_mainlog which I understand is the mail-log file.

It instantly rose back to 1mb within a minute or so, thats pretty fast - is there anyway I can find out why this is growing so fastly?

Would it be safe to put /var/log/ in /home/log/ and then symlink /var/log/ to /home/log/ ?
Hello,

If that log file is growing that fast, then better have a look inside (cat, less, more) and post some lines here to see if we can pinpoint what's going on.

Kind regards,

Eric
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Missing Diskspace canyonbreeze Linux - General 4 02-04-2010 10:08 AM
Missing Diskspace? Casper36410 Linux - General 2 11-14-2007 07:21 PM
OMFG, where is that diskspace going to .. Manu-M *BSD 4 09-03-2004 05:47 PM
diskspace.... yenonn Slackware 5 03-19-2004 08:39 PM
how to check diskspace nbtaher Linux - General 1 05-16-2002 07:42 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:39 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration