The drive is constantly filling up. You've hunted down all the spare and random files you can. grep'd for coredump files and even removed some of the un-needed backups...
What would be your next move.
The actual server in question has 10GB of website files and the OS shouldn't take any more than 10GB so how do you track down what's filling a 50GB (virtual) drive?
Surely there are more elaborate ways, but the one I remember is
Now take the directory that uses up most space
(du --max-depth=1 -h /yourdir)
and go deeper until you find your culprit.If want your output sorted by size and don't care for the human-readable format, you could also do
du --max-depth=1 /your_dir | sort -n
I find ncdu (http://dev.yorhel.nl/ncdu) to be quite helpful for this.
I use the Gnome program baobab. You can run this on your desktop and t can connect via SSH to the server. It shows an easy to read graphical map of disk space usage. It's installed under Gnome as "Disk Usage Analyzer"
Give gt5 a try.
df -k shows which fs are the problem. Then cd to the top level dir for it and run du -xk | sort -n | tail -25 this will show the top 25 dir, sorted, for sun 9 or earlier, replace the x with a d.
Note that files can be deleted while still being written to, so they use diskspace while their creating process is running, but not have a filename.
This makes it unfindable with the usual tools - you can use lsof to investigate which processes have open files.
If you can run software on the system, then xdiskusage will graphically show you which directories/files are eating your space. Extremely useful.
I believe KDE contains something similar.
If it's text-only and you cannot install extra software, then creative use of
du
will probably get you there as well.here's something I cobbled together to track down some rogue processes on our database servers: rabbitfinder
it's kinda kludgey and not very robust, but it works thusly:
ps -lFp
will show the files what process owns themYou can use the following commands to find what files or folders taking too much space.
E.g. to display the biggest top 20 directories in the current folder, use the following one-liner:
or:
For the top 20 biggest files in the current directory (recursively):
or with human readable sizes:
You can define these commands as aliases (e.g. add to your rc files such as
.bash_profile
):Then run
big
orbig-files
inside the folders which you think take place (e.g. in/home
).