Archived

This topic is now archived and is closed to further replies.

Weird running out of space problems

This topic is 4948 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Recently, I was getting some weird errors about running out of space on my 18 GB / partition (everything but things in /mnt (obviously) and /home is on this / partition). This is really weird as I''ve never had problems like that even when I originally ran linux on a 2 GB partition years ago. I have run df -h and it says indeed that I only have 578 MB available. But I still don''t believe it. I have also run du -h to try to pinpoint what''s taking up so much space, but I can''t locate it as of yet. All I can think of is maybe I had some filesystem error and should possibly check/repair it? Anyone else had these problems or know what to do? And FYI, I''m running Gentoo with Gentoo''s modified 2.6.3 kernel.

Share this post


Link to post
Share on other sites
add this line to your ~/.bashrc file:

alias ducks='du -cks * |sort -rn |head -20'


typing 'ducks' will give you the top 20 biggest files under the current directory (running in / will take a little while)



[edited by - grazer on May 17, 2004 6:24:13 PM]

Share this post


Link to post
Share on other sites
I''m not a Gentoo user, but don''t they probably keep all the downloads and interm. files in a directory somewhere from all your compiles? Might want to see where they do that and check the directory size.

You might also have something spamming your log files. Take a look in /var/log, might be something going on.

Int.

Share this post


Link to post
Share on other sites
quote:
Original post by grazer
add this line to your ~/.bashrc file:

alias ducks=''du -cks * |sort -rn |head -20''


typing ''ducks'' will give you the top 20 biggest files under the current directory (running in / will take a little while)



[edited by - grazer on May 17, 2004 6:24:13 PM]


Run that command under root (without the "head -20"), and redirect to a file:
du -sk | sort -nr > ~/all_dirs.txt
Then vi the ~/all_dirs.txt
And go through the list, looking for directories which take up more space than you expect.

The number on the left is the size in KB of the contents of the directory and all subdirectories underneath it.


http://www.anywherenotes.com - never lose another note again.

Share this post


Link to post
Share on other sites
Gentoo keeps the downloaded source files in /usr/portage/distfiles and the untarred source in /var/tmp/portage. Normally the untarred source is removed after an emerge, but if the emerge fails or is cancelled, the source remains. This can pile up fast. (OpenOffice takes ~3.5.GB of space to compile).

/var is a good place to start for cleaning up files, as well as /tmp.

Share this post


Link to post
Share on other sites
If you did a quick clean up of the likely culprits and still are short on space, you need to do one of the hints given here already to isolate your largest directory(ies). Then investigate that as well.

You can also use the find command with the +|- size option to find specific files as well.

Int.

Share this post


Link to post
Share on other sites
quote:
Original post by Strife
Files in /var have been cleaned up though. And I *still* have these problems.

I offered a simple solution. Look for big space wster after running the command I gave you.

Share this post


Link to post
Share on other sites
I did, and absolutely nothing happened.

I have, of course, already tried du -h and written the output to a file and browsed it, but without being able to sort it, it''s really damn hard to read (I did grep for all the parts that were in the gigabytes, but none of those things were anything that shouldn''t have been that big (only a couple things, and all externally-mounted hard drives).

Share this post


Link to post
Share on other sites
I tell you what, just post your root password and your ip, and I will log in and search your drive. Short of that, noone can see your disk but you. You said you can''t sort the output by size, but I (and others) already posted how you can

If you run du->sort->head and it doesn''t show you any large files, then you will just have to search manually. It is possible that you may have some errant script that is creating way too many files in a dir somewhere...

To brute force it, just go to root and do this:

#du -ah --max-depth=1

That will show you the sizes of the dirs in root. One of them will be very big. Go into that dir and run it again, one of the subdirs will be very big. Go into that subdir and run it again. I am sure you see the pattern by now...

You will soon find the problem file(s).

Share this post


Link to post
Share on other sites
I know that, that''s basically what I''ve been doing. Please don''t treat me like someone who doesn''t know how to do anything, as I am certainly not. If someone gives me a suggestion that I didn''t know how to do already, I try it. I simply said that that specific command did nothing for me (possibly meaning I don''t have sort).

Unfortunately, I am away from my computer now for about a week, so I won''t actually be able to work on it. But hopefully I can find out what the problem is soon.

Share this post


Link to post
Share on other sites
quote:
Original post by Strife
I know that, that's basically what I've been doing. Please don't treat me like someone who doesn't know how to do anything, as I am certainly not.



No flame intended, just trying to help out


quote:
Original post by Strife
If someone gives me a suggestion that I didn't know how to do already, I try it. I simply said that that specific command did nothing for me (possibly meaning I don't have sort).



Possible, but highly unlikely. 'sort' is part of the same GNU coreutils package that contains 'du', so if you have one...

Anyway, I had assumed that you were having trouble with the sort command because you said you were using 'du -h'. The h flag will make the output unsortable because of the fancy human readable formatting. In order to sort, you have to be returning a set format (like bytes). So, in other words, the command line I posted should work just fine to sort the output for you. Failing that, following the directions in my last post (use a max-depth of 1) will find the problem for you!

quote:
Original post by Strife
Unfortunately, I am away from my computer now for about a week, so I won't actually be able to work on it. But hopefully I can find out what the problem is soon.



Let us know how it works out.



[edited by - grazer on May 20, 2004 10:46:10 AM]

[edited by - grazer on May 20, 2004 10:48:02 AM]

Share this post


Link to post
Share on other sites
Well, I''ve finally run the sorting command, and I see that these are my biggest problems:

2278408 ./mnt/media/music
393158 ./proc
193760 ./usr/lib
172592 ./usr/portage/distfiles
169532 ./usr/lib/wine/lib/wine
159764 ./opt/OpenOffice.org/program
140144 ./mnt/media
110540 ./usr/bin
74896 ./var/log
65576 ./usr/kde/3.2/lib

The mnt directories aren''t of any concern because they are other hard drives (so unless some weird stuff happens where it thinks that the mount point / has less space because of these, it can''t be the problem). I''m a little concerned as to why /proc is so large though. Any ideas?

Share this post


Link to post
Share on other sites
Nevermind. It seems that the next line down was the cache directory from Firefox. Somehow it had gotten huge, and after clearing that, things are fine O_o

Share this post


Link to post
Share on other sites
I realize you've fixed the problem, but just in case...

You can probably save space by deleting stuff in /usr/portage/distfiles, since this is where all the source that portage downloads gets put

If you have a fast connection there's little point in keeping stuff there if space is an issue (you won't re-use most of the stuff), and it could at least he helpful to delete stuff that's outdated (like if you have the source for an older version of open office or kde etc)

Deleting everything in /var/tmp/portage is apparently ok too (this get's really big if open office fails to compile after 9 hours )

Careful use of emerge clean and emerge depclean (but do revdep-rebuild after) might save some space

You might also like to take a look at this: clicky though it probably won't save that much space

edit: sorry, just realised that someone else had already told you a lot of that anyway

[edited by - metal leper on May 31, 2004 8:52:02 AM]

Share this post


Link to post
Share on other sites