-   Linux - Newbie (
-   -   Running out of disk space (

rpersaud 05-17-2005 11:01 AM

Running out of disk space
I am new to Linux, and have setup LAMP on Mandrake 8.1 on a 8 GB harddrive, that was already partitioned by someone (unknown).

I also have Jakarta Tomcat installed, and normally, I would delete the log files from both Apache2 and Tomcat to get more available space on the root partition. Lately, the disk space becomes less available I haven't been able to identify why - but its not related to the log files from Apache2 or Tomcat since they're all deleted.

Searching google and related forums here didn't help me. So, using suggestions from related posts here to provide yall with information:

#df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 3.4G 3.2G 88M 98% /
none 62M 0 61M 0% /dev/shm
/dev/sda6 4.7G 923M 3.8G 19% /home

#fdisk -l
Disk /dev/scsi/host0/bus0/target2/lun0/disc: 255 heads, 63 sectors, 1106 cylinde
Units = cylinders of 16065 * 512 bytes

Device Boot Start End Blocks Id
/dev/scsi/host0/bus0/target2/lun0/part1 * 1 446 3582463+ 83
/dev/scsi/host0/bus0/target2/lun0/part2 447 1107 5304585 5
/dev/scsi/host0/bus0/target2/lun0/part5 447 477 248976 82
Linux swap
/dev/scsi/host0/bus0/target2/lun0/part6 478 1107 5055546 83

#cat /proc/partitions
major minor #blocks name rio rmerge rsect ruse wio wmerge wsect wuse runni
ng use aveq

8 0 8887080 scsi/host0/bus0/target2/lun0/disc 7881228 9173654 13634930
8 28455420 3959908 4838074 70658512 5166798 0 40578600 33626688
8 1 3582463 scsi/host0/bus0/target2/lun0/part1 7637227 8852597 1319192
82 25834850 3064757 3859108 55641816 8397221 0 37465370 34232581
8 2 1 scsi/host0/bus0/target2/lun0/part2 0 0 0 0 0 0 0 0 0 0 0
8 5 248976 scsi/host0/bus0/target2/lun0/part5 79046 186036 2120656 58
9230 37960 147639 1578072 2239500 0 807620 2831560
8 6 5055546 scsi/host0/bus0/target2/lun0/part6 164950 134990 2309298 2
033370 857191 831327 13438624 37480420 0 13825760 39514420

I hope this helps, if not, please advise on how I may better help myself resolve this issue. Thanks!~

david_ross 05-17-2005 02:08 PM

Welcome to LQ.

Try using du to find what directories are using all of your space:
du -hs /tmp
du -hs /var
du -hs /usr

You could check them all at the same time with:
cd /
du -hs *

but the ones I gave at the top are the most likely. Once you find one that is obviously bigger than it should be you can cd into that directory and repeat the procedure for the directories below it.

rpersaud 05-17-2005 02:50 PM

Thanks for responding!
FYI, I find this site extremely helpful by just browsing.

Using the du -hs * suggestion above, it shows that my /usr folder is 1.7G. Using the same command in this folder, I yield these results:

102M bin
4.0K etc
20K games
26M include
368M lib
44K libexec
362M local
16M sbin
538M share
165M src
0 tmp

What I need to know is what am I allowed to delete here without affecting any other part of the Linux OS? Should I delete lib, share, and parts of local? I know that I place most of my 3rd party applications such as mysql, php, tomcat, and apache under /usr/local.

Or to further complicate the issue, how can I find out what keeps "growing" in size under /usr? Other than to monitor the /usr directory to see which directory changes in size over a period of time. Thanks,

david_ross 05-17-2005 03:25 PM

You have quite a large source (src) dir which could probably be emptied. You could probably scap your man pages as well and just look them up online, man also keeps a preformatted copy which could always be deleted regardless.

Monitoring the size is about the only way to see it change.

jschiwal 05-17-2005 03:48 PM

If /var/cache is in the same filesystem, It might contain cached rpm files. Also, search your system for core files. They can be deleted. The lilo setup section of drakeconf (mcc) has an option to empty /tmp when rebooting.

rpersaud 05-17-2005 05:08 PM

Strange Events
When I stopped Tomcat, Apache2, and MySql, the disk space went from 99% filled to 58% filled on /.

I must say that my disk space problems sound more connected with LAMP?

Otherwise, thanks for all the advice so far! I've tried each of them , from emptying src, man, etc. Thanks!

david_ross 05-18-2005 02:57 PM

Which directory gained the space when you shut those services off?

Genesee 05-18-2005 05:19 PM

here is a very small and simple graphical display for du - it's helpful to get a visual read on what's taking space and where:

brainiac 05-18-2005 08:05 PM

Thanks for xdiskusage, I have been looking for something like this for a while.

All times are GMT -5. The time now is 12:57 AM.