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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
10-31-2005, 08:36 PM
|
#1
|
|
Member
Registered: Nov 2004
Distribution: Fedora Core 2
Posts: 330
Rep:
|
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
|
|
|
|
10-31-2005, 08:46 PM
|
#2
|
|
Member
Registered: Nov 2004
Distribution: Fedora Core 2
Posts: 330
Original Poster
Rep:
|
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!
|
|
|
|
10-31-2005, 08:49 PM
|
#3
|
|
Member
Registered: Nov 2004
Distribution: Fedora Core 2
Posts: 330
Original Poster
Rep:
|
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...
|
|
|
|
10-31-2005, 09:40 PM
|
#4
|
|
Guru
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Debian Squeeze, Fedora 14
Posts: 7,268
Rep:
|
"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
|
|
|
|
10-31-2005, 11:06 PM
|
#5
|
|
Member
Registered: Oct 2005
Location: A safe distance from Detroit
Distribution: SuSE 10.0, Knoppix
Posts: 97
Rep:
|
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!
|
|
|
|
11-01-2005, 01:20 AM
|
#6
|
|
Member
Registered: Nov 2004
Distribution: Fedora Core 2
Posts: 330
Original Poster
Rep:
|
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...
|
|
|
|
11-01-2005, 02:02 AM
|
#7
|
|
Member
Registered: Nov 2004
Distribution: Fedora Core 2
Posts: 330
Original Poster
Rep:
|
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....
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 02:23 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|