LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices



Reply
 
Search this Thread
Old 04-27-2004, 04:56 AM   #1
HomeBrewer
LQ Newbie
 
Registered: Dec 2003
Location: Massachusetts, USA
Posts: 17

Rep: Reputation: 0
Root partition dangerously full


My root partition is becoming dangerously full. How can I investigate what specific files in this partition are the disk hogs, with an eye toward deleting those I can?

df -h produces:

Filesystem Size Used Avail Use% Mounted on
/dev/hda5 496M 426M 45M 91% /
/dev/hda1 98M 9.2M 84M 10% /boot
/dev/hda3 15G 3.1G 11G 22% /home
none 78M 0 78M 0% /dev/shm
/dev/hda2 40G 3.5G 35G 10% /usr
/dev/hda6 1008M 388M 569M 41% /var


So, I guess my question is how do I produce a listing of only files that occupy the /dev/hda5 device?

This is a Red Hat 9.0 system, in server configuration. My first thought was a log file getting huge, but they're in /var/log, thus hda6.

Thanks for your help...
 
Old 04-27-2004, 05:20 AM   #2
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 655Reputation: 655Reputation: 655Reputation: 655Reputation: 655Reputation: 655
du (disk usage) will display the sizes of files and directories.
using the -x (or the long-form option --one-file-system) will stay in the local filesystem.
Use the -a (--all) option to display the sizes of files also. If you want to pipe the output through sort, you may want to also use the -b option for du and the -n option for sort: du -abx / | sort -n
This will produce a list sorted by size.

Also, look for core files. they can be very big. That is why normally during startup, ulimit is used to disable the dumping of a core file when a program crashes. (A computer with 1 gig of memory, may write a 1gig core file, if ulimit doesn't limit core file sizes.

You could also delete files in the /tmp directory. If your /var partition was on /dev/hda5, I would suggest checking that the log files are rotating.

----

As an aside, to newbies reading this, I would suggest reading the info pages for coreutils.
For a more readable version, try entering in the konqueror Location bar:
info:/coreutils

Last edited by jschiwal; 04-27-2004 at 05:25 AM.
 
Old 04-27-2004, 06:32 AM   #3
HomeBrewer
LQ Newbie
 
Registered: Dec 2003
Location: Massachusetts, USA
Posts: 17

Original Poster
Rep: Reputation: 0
Thank you for your reply. After I posted, I went back and looked at my LogWatch reports. There was a sudden increase (12%, 56M) in usage of hda5 overnight:

Report for 4/26/04:

Filesystem Size Used Avail Use% Mounted on
/dev/hda5 496M 371M 101M 79% /
/dev/hda1 98M 9.2M 84M 10% /boot
/dev/hda3 15G 3.1G 11G 22% /home
none 78M 0 78M 0% /dev/shm
/dev/hda2 40G 3.5G 35G 10% /usr
/dev/hda6 1008M 403M 554M 43% /var


Report for 4/27/04:

Filesystem Size Used Avail Use% Mounted on
/dev/hda5 496M 427M 45M 91% /
/dev/hda1 98M 9.2M 84M 10% /boot
/dev/hda3 15G 3.1G 11G 22% /home
none 78M 0 78M 0% /dev/shm
/dev/hda2 40G 3.5G 35G 10% /usr
/dev/hda6 1008M 404M 553M 43% /var


I did install TeamSpeak on this machine a couple of days ago, but it's on /var (hda6). I just started getting DiskWatch reports (hourly) this morning...

I guess to track this down further, I'll need to sort by file date also, to see what caused the suspicious jump in disk usage last night. I tried find / -mount -mtime -2 but that does not show the sizes of the files.

The output from the command you suggested prompts another question -- it seems I have quite a few files occupying significant space in the /lib/modules directory related to older kernels:

drwxr-xr-x 3 root root 1024 Dec 25 21:57 2.4.20-27.9
drwxr-xr-x 3 root root 1024 Jan 11 23:11 2.4.20-28.9
drwxr-xr-x 3 root root 1024 Feb 23 00:14 2.4.20-30.9
drwxr-xr-x 3 root root 1024 Dec 25 17:40 2.4.20-8


Now, the files in these directories could not be the cause of my sudden increase, but are the files related to the older kernels (2.4.20-8, 2.4.20-27.9, and 2.4.20-28.9) safe to delete, just to give me some breathing room while I figure this out?

Quote:
Originally posted by jschiwal
Also, look for core files. they can be very big...
A good idea, but -- and you knew this was coming -- how do I look for them? There is a file /dev/core, of type "character device", dated 1/30/2003, and of size is 0, but somehow I don't think this is what you're referring to...

Quote:
Originally posted by jschiwal
You could also delete files in the /tmp directory. If your /var partition was on /dev/hda5, I would suggest checking that the log files are rotating.
My log files are rotating. There are some files in the /tmp directory, I assume they're all safe to just erase without further ado?

Last edited by HomeBrewer; 04-27-2004 at 07:38 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
root partition full laan97ac Mandriva 6 07-23-2007 02:09 PM
root partition full, not sure how; where are my files? lefty.crupps MEPIS 10 01-31-2006 06:21 PM
root ('/') partition is FULL inon^ Linux - Hardware 2 08-08-2005 02:19 PM
Root partition is full, what now? Joe Soap Linux - Newbie 30 03-31-2005 12:38 PM
root partition shows 100% full in RH 7.2 dmcmurray5 Red Hat 2 05-18-2004 04:24 PM


All times are GMT -5. The time now is 02:01 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration