View previous topic :: View next topic |
Author |
Message |
JamesCurtis n00b
Joined: 07 Dec 2006 Posts: 39
|
Posted: Tue Jun 12, 2007 7:14 pm Post subject: 100% disk usage [SOLVED] |
|
|
Hey guys, I was doing just some regular activities today and it stopped a copy due to there being no space left on the disk. I did a DF and it did say that 100% was used, but I cannot think of how i would've already filled up 80gig of info on it. I did a find to find files over a certain size, but what I really want to know is how to I do a find to find the largest directories on the system? Thanks guys!
Last edited by JamesCurtis on Wed Jun 13, 2007 1:25 pm; edited 1 time in total |
|
Back to top |
|
|
depontius Advocate
Joined: 05 May 2004 Posts: 3509
|
Posted: Tue Jun 12, 2007 7:22 pm Post subject: |
|
|
Go to the mount point of the full filesystem, and:
du -kx >(a file somewhere that has some space)
You may/will need to sort the output, but it'll give you space, directory by directory. The "-k" gives kbytes instead of blocks, and the "-x" confines it to the one filesystem, instead of digging into other mounted filesystems under the current mount point. _________________ .sigs waste space and bandwidth |
|
Back to top |
|
|
JamesCurtis n00b
Joined: 07 Dec 2006 Posts: 39
|
Posted: Tue Jun 12, 2007 7:36 pm Post subject: |
|
|
anyone know a good doc that will teach me how to sort? I can't seem to get the grip of how you sort a text file. Thanks |
|
Back to top |
|
|
GivePeaceAChance Guru
Joined: 26 May 2007 Posts: 480
|
Posted: Tue Jun 12, 2007 8:06 pm Post subject: |
|
|
If you want to sort a textfile by lowest number to highest number:
i.e. numbers.txt
6
22
852
3
-15
356
-3367
simply use
Code: | sort -n numbers.txt > numbersSorted.txt |
AFAIK, this will sort the file from least to greatest numbers and send it to a new file called numbersSorted.txt.
If you want alphabetical sorting of a file, just use
Hope this helps, and if I'm wrong about my commands, someone please correct me.
EDIT:
This is useful if you've got a textfile full of just names or numbers you need sorted. I don't know what would happen if it was a file with a variety of text/numbers in it.
Last edited by GivePeaceAChance on Tue Jun 12, 2007 8:07 pm; edited 1 time in total |
|
Back to top |
|
|
JamesCurtis n00b
Joined: 07 Dec 2006 Posts: 39
|
Posted: Tue Jun 12, 2007 8:06 pm Post subject: |
|
|
nevermind, I found it. I used the sort -g on the file and found that my /var/log/messages had become 70gig large. I'm in the process of attempting to open it to see what happened. I did have a bad hard drive hooked up to it transferring data, so maybe it got stuck on an error. Anyways, thanks for the help depontius! I just have one last question though, how do i get df to recognize the released space? even after i deleted the 70gig file it said it's 100% full. I had to restart to get it to refresh, and I don't like rebooting my linux machine lol
Thanks! |
|
Back to top |
|
|
x22 Apprentice
Joined: 24 Apr 2006 Posts: 208
|
Posted: Wed Jun 13, 2007 9:49 am Post subject: |
|
|
wrote: | even after i deleted the 70gig file it said it's 100% full. I had to restart to get it to refresh, and I don't like rebooting my linux machine lol
|
This usually mean that the file is open.
/var/log/messages was probably open by syslog. So restarting syslog would be enough. |
|
Back to top |
|
|
JamesCurtis n00b
Joined: 07 Dec 2006 Posts: 39
|
Posted: Wed Jun 13, 2007 1:24 pm Post subject: |
|
|
Thanks everyone, I'll close the topic |
|
Back to top |
|
|
larand54 l33t
Joined: 20 Feb 2004 Posts: 695 Location: Sweden
|
Posted: Wed Jun 13, 2007 1:28 pm Post subject: |
|
|
If you want to read that big file you may get some problem but you can at least look at the last lines for instance:
Code: | tail -n 3 /var/log/shorewall.log |
the opion -n 3 tells the command to print the 3 last lines in the file. |
|
Back to top |
|
|
|