Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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!

share|improve this question

3 Answers 3

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.

share|improve this answer
    
Oh that's much simpler than my method =) –  sam May 16 '11 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 '11 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... –  Holocryptic May 16 '11 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 '11 at 9:27

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.

share|improve this answer

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.

share|improve this answer
    
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 '11 at 3:33

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.