Hard drive space management.
Hi,
I have a web server running centos. The hard drive just keeps filling up by about 1-2G a day, and I can't figure out whats using the space. Filesystem Size Used Avail Use% Mounted on /dev/sda1 24G 17G 5.7G 75% / tmpfs 250M 0 250M 0% /dev/shm /dev/sdb1 15G 319M 14G 3% /storage My site is stored in /var/www/html [root@centos www]# pwd /var/www [root@centos www]# du -h | grep -v ./ 74M . [root@centos www]# du -h is showing the i'm using 74M in /var/www [root@centos log]# pwd /var/log [root@centos log]# du -h | grep -v ./ 2.2M . Logs are only showing 2.2M So either du isn't working or I am using it wrong... [root@centos log]# cd / [root@centos /]# du -h | grep -v ./ 2.5G . So maybe the file thats taking up the space is undetectable by du? |
Have you ever tried this:
du -sh /* To see what root folders occupy the space? |
You may find that /var/log is the culprit. I always suspect a runaway log file when my root disk fills to capacity. I've seen 'sar' files bring down a RedHat system more than once.
|
How is du -h /* different to running du -h in / ?
Yea it probably is /var/log but I can't see anything in there taking up space. |
If it's one large file or a few large files, "du -kSx | sort -rn | less" will catch it.
If it is an accumulation of small files, you may have better luck if you drop the 'S' and try "du -kx | sort -rn | less" Opinion: I think 'du' and 'ls' see almost everything. The exception, files in directories that have had filesystems mounted over them. E.g. You put a file 'bigfile' in directory /example, then you 'mount /dev/sdd4 /example'. 'ls' can no longer see 'bigfile'; and 'du' can no longer see it either. 'df' will accurately reflect the space occupied by 'bigfile'. When you 'umount /dev/sdd4', 'bigfile' will again be accessible. I just mention this in passing. This would not be your problem. |
All times are GMT -5. The time now is 04:15 AM. |