-1

Possible Duplicate:
ubuntu server slowly filling up
100% disk full on Centos?

I'm managing web service by using Apache,PHP,MySQL on Ubuntu Server.20 web sites are running.

Almost once a day, Server does not work properly because of being full of root(/) partition. I deleted apache error log because it increased. However, that didn't solve the problem.

When I reboot the server, it works well again. What should I do now? Please help me.

Capacity of root(/) partition is 20GB, home partition is 437GB.

busang
  • 1
  • 1
  • Why is the disk filling up? – Michael Hampton Jan 06 '13 at 16:49
  • Probably any log or cached files, you should identify which files are being created during server uptime – 0wn3r Jan 06 '13 at 16:49
  • 1
    just type into the shell **find /root -type f -ctime n** (where n stands for n*24 hours ago, so if you want to find files created 1 day ago the value is 1) , identify which files are created during server uptime in the /root partition. – 0wn3r Jan 06 '13 at 16:55
  • @0wn3r Also add `-xdev` to restrict the search to the single filesystem. – Michael Hampton Jan 06 '13 at 19:20

5 Answers5

2

You obviously have not enough space on your root partition. Some methods to alleviate this problem:

  • Check your logrotate settings, maybe you keep to many log files.
  • Check your log details settings on the various services that write log files. Some just log too much.
  • Move the log files (/var/log) to another partition with more space.
  • Check what else is using up space. MySQL perhaps? Can you move this?
  • Repartition your disk to give root more space (can be quite difficult).
Sven
  • 98,649
  • 14
  • 180
  • 226
2

Short answer: find out where your space is being eaten up.

find / -type d | xargs du -s | sort -g

Long answer: put your /var directory on a separate, isolated partition so that your system doesn't crash when this happens, if it is (indeed) a log problem.

Andrew M.
  • 11,182
  • 2
  • 35
  • 29
1

do you have graphical interface on the server ? if yes just use this tool: http://gdmap.sourceforge.net/ is just crazy ! :) you can easily find what's consuming so much space.

   screenshot of gdmap

slm
  • 7,615
  • 16
  • 56
  • 76
Buda Florin
  • 111
  • 2
1

Use the ncdu utility to provide a text-based drill-down tree of the filesystem. This will help you identify the directories containing the bulk of your data.

ewwhite
  • 197,159
  • 92
  • 443
  • 809
0

In the same vain as @Buda Florin's post about gdmap there is also fsview. It's a KDE addon to Konqueror but runs just fine standalone on GNOME. Check out this blog post for more info on it.

Here are some screenshots of fsview in action

   fsview #1    fsview #2    fsview #3

slm
  • 7,615
  • 16
  • 56
  • 76