Analysing disk space useage

I have noticed lately that the disk space on my server has been increasing quite a bit every month. Is there a FreeBSD utility that can tell me what directories are using the most disk space? Almost like showing me the top 10 (or whatever) folders that are using the most disk space.

I basically just want to know whats taking up the disk space in my system without having to go through all the directories manually.

Thanks for any help! :e
 
That was helpful, thank you!

I tried:
Code:
 du -h -d 3 /usr/home/

as a start. Is there a way to display the biggest directories first? I couldn't find an option like this in the man file. Is there another way to do it?
 
well something like this
$ du -d 3 /usr/home/ | sort

but I'm not sure it will be good enough, you can use grep to extract for examle M/G etc and then sort

$ du -h -d 3 /usr/home/ | grep M | sort
Still not perfect, but works for me sometimes
 
I'm a bit confused. I ran the following command:
Code:
du -c -h -d 100 /

on every directory that was off the root and I roughly got about 4GB of space used in total.

But if I log into Webmin it says I am using 9.57GB!

However, if I run the following command:
Code:
df -g

Filesystem                 1G-blocks Used Avail Capacity  Mounted on
/dev/mirror/RootMirror4s1a        69    4    59     6%    /
devfs                              0    0     0   100%    /dev

It confirms that I AM using only 4GB of space! Why is there the discrepency? Has it got to do with the swap space maybe?

PS: My swap file size is 3.4GB so adding that to 4GB gives me 7.4GB, still way under what Webmin reports!
 
Is webmin looking at the mirror device, or the two separate drives? If it's looking at the individual drives, then obviously it will be doubled. :)
 
Thats a good point phoenix!

Webmin is reporting space on the following device:
Code:
/dev/mirror/RootMirror4s1a

for root (/).

But if I type:
Code:
df -g
I get:
Code:
Filesystem                 1G-blocks Used Avail Capacity  Mounted on
/dev/mirror/RootMirror4s1a        69    3    59     6%    /

So I think Webmin is monitoring the mirrored device...I am confused now as they are both monitoring the same device but theres still a discrepency!
 
Back
Top