LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-31-2005, 08:36 PM   #1
Niceman2005
Member
 
Registered: Nov 2004
Distribution: Fedora Core 2
Posts: 330

Rep: Reputation: 30
My harddisk usage is 91% but I cannot figure out what occupies so much space...


Dear friends,


This morning my squid server terminated for the first time since it was born. After checking I realised the harddisk was full and the log files were getting too huge. Upon deleting some of the log files, squid managed to start again, However when I checked the hard disk usage it gives me 91% being used:

# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/hda2 28G 24G 2.6G 91% /
/dev/hda1 97M 7.7M 85M 9% /boot
none 122M 0 122M 0% /dev/shm


I have deleted many of the log files and tried to track down what is occupying so much of the hard disk but failed to find out.
I couldn't track down where in the harddisk has been used so much. I tried ls -sh on each directory but all the directories seem to occupy K size which isn't likely to be the souce of the space being used.

I did this:
#cd /
# ls -sh
total 258K
4.0K bin 4.0K home 4.0K misc 4.0K root 0 sys
1.0K boot 1.0K initrd 4.0K mnt 12K sbin 4.0K tmp
168K dev 4.0K lib 4.0K opt 4.0K selinux 4.0K usr
12K etc 16K lost+found 0 proc 4.0K share 4.0K var

from above, it doesnt seem like any of the directory is occupying much space? Any idea why the harddisk has been used so much?

thanks a lot for taking time reading my mail,

Regards
Yong
 
Old 10-31-2005, 08:46 PM   #2
Niceman2005
Member
 
Registered: Nov 2004
Distribution: Fedora Core 2
Posts: 330

Original Poster
Rep: Reputation: 30
continue

In addition to that previous thread:

I tried to use the GUI SystemTools -> System monitor, it shows the following:

Name Directory Type Total Used %
/dev/hda1 /boot ext3 96.7MB 7.5MB 8
/dev/hda2 / ext3 72.5GB 9.9GB 14


Is this the same thing as the one df -h shows?

thanks for helping!
 
Old 10-31-2005, 08:49 PM   #3
Niceman2005
Member
 
Registered: Nov 2004
Distribution: Fedora Core 2
Posts: 330

Original Poster
Rep: Reputation: 30
Hi friends..
Sori. the previous thread (Abt System Tools -> System monitor
Was a mistake...ignore the second thread...I checked the wrong machine...sorri....pls help me with the first thread....sorry...
 
Old 10-31-2005, 09:40 PM   #4
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,387

Rep: Reputation: 581Reputation: 581Reputation: 581Reputation: 581Reputation: 581Reputation: 581
"I couldn't track down where in the harddisk has been used so much. I tried ls -sh on each directory but all the directories seem to occupy K size which isn't likely to be the souce of the space being used."

The command that I use in this situation is du. du will display the size of a portion of your file system. Some examples are:

du /var -s -h
du /var/log -s -h

du /home -s -h
du /home/user1 -s -h

du /usr/lib/iptables -s -h


-----------------------------------
Steve Stites
 
Old 10-31-2005, 11:06 PM   #5
ahedler
Member
 
Registered: Oct 2005
Location: A safe distance from Detroit
Distribution: SuSE 10.0, Knoppix
Posts: 99

Rep: Reputation: 17
I also use du to track down the disk hogs, but I do it like this:

cd /; du -sk * | less (or more, or put it into a file)

Look for the biggest one, then cd to that dir and repeat the du -sk * to see which dir is using the most. Take a look at each dir you test from to see if there is something huge there, like a core file or a monster log file. Hope this helps!
 
Old 11-01-2005, 01:20 AM   #6
Niceman2005
Member
 
Registered: Nov 2004
Distribution: Fedora Core 2
Posts: 330

Original Poster
Rep: Reputation: 30
Hi guys!

thanks a million for your help! It helped me a lot. While using the du command to check each diretory size. I encountered something confusing.

one eg is that I checked on the tmp direcotry /tmp: du tmp -s -h gives 219M

then when I cd tmp to check the files inside:
#cd tmp
#ls -sh
total 4.0K
0 authfail.log 0 authfail.log.unsort 4.0K sarg
0 authfail.log.1 0 denied.log.unsort
0 authfail.log.2 0 mapping-root

from above it shows that the total file size inside /tmp only total to 4.0K, how is it possible to get to 219M?

the same happened to my /var/log/squid directory. I have reduzed the size of the log files but the outer most directory still shows Mega size which isn't total to its content...

Is there anything I have misunderstood abt the du command ?
thanks for taking time helping...
 
Old 11-01-2005, 02:02 AM   #7
Niceman2005
Member
 
Registered: Nov 2004
Distribution: Fedora Core 2
Posts: 330

Original Poster
Rep: Reputation: 30
Sorry guys....

I made mistake again......I realised there are some really large hidden files...so when I use ls -alsh it showed that. really huge hidden log files....
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
harddisk usage woodland56 Debian 3 09-19-2005 08:16 PM
my harddisk is run out space ,what should i do . ztdep Linux - Software 7 08-05-2005 03:16 AM
reconfiguring harddisk space amimusa Linux - General 1 04-09-2005 12:38 PM
Low Harddisk space. Can I just transfer the entire Linux to a bigger harddisk? davidas Linux - Newbie 12 04-13-2004 02:03 AM
Remaining space on harddisk WiWa Linux - General 4 10-19-2003 09:20 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:35 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
Open Source Consulting | Domain Registration