Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
100% disk usage [SOLVED]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
JamesCurtis
n00b
n00b


Joined: 07 Dec 2006
Posts: 39

PostPosted: Tue Jun 12, 2007 7:14 pm    Post subject: 100% disk usage [SOLVED] Reply with quote

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
View user's profile Send private message
depontius
Advocate
Advocate


Joined: 05 May 2004
Posts: 3509

PostPosted: Tue Jun 12, 2007 7:22 pm    Post subject: Reply with quote

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
View user's profile Send private message
JamesCurtis
n00b
n00b


Joined: 07 Dec 2006
Posts: 39

PostPosted: Tue Jun 12, 2007 7:36 pm    Post subject: Reply with quote

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
View user's profile Send private message
GivePeaceAChance
Guru
Guru


Joined: 26 May 2007
Posts: 480

PostPosted: Tue Jun 12, 2007 8:06 pm    Post subject: Reply with quote

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

Code:
sort myFile


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
View user's profile Send private message
JamesCurtis
n00b
n00b


Joined: 07 Dec 2006
Posts: 39

PostPosted: Tue Jun 12, 2007 8:06 pm    Post subject: Reply with quote

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
View user's profile Send private message
x22
Apprentice
Apprentice


Joined: 24 Apr 2006
Posts: 208

PostPosted: Wed Jun 13, 2007 9:49 am    Post subject: Reply with quote

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
View user's profile Send private message
JamesCurtis
n00b
n00b


Joined: 07 Dec 2006
Posts: 39

PostPosted: Wed Jun 13, 2007 1:24 pm    Post subject: Reply with quote

Thanks everyone, I'll close the topic :)
Back to top
View user's profile Send private message
larand54
l33t
l33t


Joined: 20 Feb 2004
Posts: 695
Location: Sweden

PostPosted: Wed Jun 13, 2007 1:28 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum