-3

I receive these emails (on my cPanel Linux Cent OS 5 Server) every day and haven't a clue what they mean or what to do;

Drive Warning: /dev/root (/) is 81% full
Drive Critical: /dev/vg00/var (/var) is 92% full

How can I sort this easily? I have full root and SSH access

jscott
  • 24,204
  • 8
  • 77
  • 99
James Anderson
  • 2,947
  • 2
  • 16
  • 12
  • 5
    Your drives are almost full. – Ignacio Vazquez-Abrams Sep 18 '11 at 12:01
  • but... of what? – James Anderson Sep 18 '11 at 12:10
  • 8
    Of​.​.​. files. – Ignacio Vazquez-Abrams Sep 18 '11 at 12:11
  • 2
    @JamesAnderson - We can't tell you "of what" based on the info here and we can't tell you what to keep and what to delete. Those are things that the person administering the server needs to know and take care of. – Rob Moir Sep 18 '11 at 12:49
  • that's a bit of a stupid thing to say, there's all sorts of log files etc which could be causing the problems. There are some standard files you know, not just random ones I've created. Make a more useful comment next time... – James Anderson Sep 18 '11 at 13:09
  • 1
    @JamesAnderson - We really can't tell you "of what". We don't have any access whatsoever(we can't even identify the server, or what disks it has), while you have full access. You are the one who is expected to know what is on there, what those files do(roughly), and why they're there. You are the one that can sort the directories by size and identify any that are growing beyond proportion. You are the one that put things there(directly, or through some daemon), and you are the one that needs to watch their size and appropriately trim them. We not only should not, but *CANNOT* do that for you. – Kevin M Sep 18 '11 at 19:28

3 Answers3

5

Actually I was in the middle of a lengthy answer, when I realized the real answer is:

  • get some shell scripting skills
  • get an overview of directory sizes under the filesystem in question
  • get an overview of file sizes for the filesystems in question
  • for each directory and file find out to which package it belongs to
    • if it doesn't belong to a package you put it there! -- STOP! You put it there, at least you told some daemon, thru some mechanism it's ok to put it there. Or you gave some user write privileges and access. So at the end of the day you are the one who should know why the file is there in the first place.
    • if it belongs to a package and you don't know what it does either take the time and read the documentation or get help from a professional and let her explain the steps to you

Now someone please go downvote me for a harsh answer. I'm in a bad mood today anyway which I think isn't the best time to give free support on internet fora (forums? what's the plural of that word in english)

Martin M.
  • 6,428
  • 2
  • 24
  • 42
2

you have 2 options

continue to ignore the emails as it looks like you have done so far, this is only asking for troubles

Or

try checking log directories and clearing out old rotated logs

check your backup isnt also being stored on your main harddrive and either copy them to another drive or ideally off the server then delete from local disk

how big is your drive and how much are your sites using of it? it may just be a plain and simple, your website files have filled and you have truly outgrown your disk (so you need a bigger one or a new server)

one other thing to check if you have stuff like cron jobs running etc and if you dont use the server for email is to check and delete mail stored on the server, for example cronjobs will send mail to the account that they run as so checking webmail in cpanel will show this and hopefully you can delete them

to check log file size

du -h --max-depth=1 /var/log

to delete files

rm -f /var/log/logfile.log

anything that has extension .gz or .(number) are more than likely safe to delete, however you may want to keep the most recent ones just in case you need to check your logs, perhaps download them from your server to your machine before you delete

anthonysomerset
  • 3,983
  • 2
  • 20
  • 24
0

Install ncdu (yum install ncdu), and run ncdu /var/log/, or you can use the following command:

# du -s /var/log/* | sort -rn | cut -f2 | xargs -d '\n' du -sh | head

to find the top biggest folder.

If you have many old rotated logs (e.g: messages.1, messages.2, ...), take a look at /etc/logrotate.d/syslog:

   /var/log/messages {
       rotate 5
       weekly
       postrotate
           /sbin/killall -HUP syslogd
       endscript
   }

Turn down the rotate to a sane value which is how many weeks (days) you want to keep the log files.

quanta
  • 50,327
  • 19
  • 152
  • 213