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 |
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! |
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... |
"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 |
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! |
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... |
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.... |
All times are GMT -5. The time now is 01:59 PM. |