0

I have my server on Mediatemple and i reached my 20GB quota. I installed Ubuntu and many plugins but I don't know how I reached that 20GB? I'm running a website but I'm sure it is not taking all that space!

0

3 Answers 3

5

sudo du -x / | sort -n will at least show you what's using space. As to whether it's legitimately using space or not is up to you to decide.

4
  • Oh that's much simpler than my method =)
    – user80776
    May 16, 2011 at 2:10
  • wow...i foudn out that all my space about 19gb is taken by logs files!!! apache/error.log is 17gb!!! should i delete them?? is it possible to set a purge weekly?
    – Francesco
    May 16, 2011 at 2:17
  • 1
    @camelCase, if you have that large of a error log file, maybe you want to investigate why you have so many errors, instead of just wiping it out... May 16, 2011 at 3:13
  • 2
    @Holocryptic is correct, but once you have done that you really need to enable logrotate so that you don't have this happen again. It compresses older logs for space and can throw away logs after a window.
    – n8whnp
    May 16, 2011 at 9:27
1

Shell in, cd to / and run

du -d 1 -h ./

(That will give you the total size of each directory).
CD to the largest directory and run the command again, rinse and repeat till you find all the big files =)

Edit:
The process might not have been 100% clear, when you run DU it'll give you a list of folders and their sizes like

2GB /foldera
1GB /folderb
[etc]

So in that case, CD into foldera and run the du command again, that'll give you the list of largest files/folders in there, keep drilling down till you find the largest files. If you don't need them, remove them.

0

If you have ssh-access and a linux box, you can easily graph your disk with baobab. This tool can also read remote folders via ssh and makes a circle diagram.

Also on my box du has no -d option and I use sudo du -h --max-depth=1 / get an overview on command line.

1
  • Are you sure your version of du doesn't support depth limiting (the -d option)?? I've never seen one that doesn't before; what OS are you running?
    – Chris S
    May 18, 2011 at 3:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .