LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 11-05-2010, 04:47 PM   #1
aaab
LQ Newbie
 
Registered: Jan 2009
Posts: 4

Rep: Reputation: 0
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?
 
Old 11-05-2010, 09:31 PM   #2
SciFi-Bob
Member
 
Registered: Aug 2008
Location: Denmark
Distribution: Ubuntu
Posts: 62

Rep: Reputation: 18
Have you ever tried this:

du -sh /*

To see what root folders occupy the space?

Last edited by SciFi-Bob; 11-05-2010 at 09:33 PM.
 
0 members found this post helpful.
Old 11-05-2010, 10:10 PM   #3
udaman
Member
 
Registered: Oct 2010
Location: New England, USA
Distribution: OpenSUSE/Slackware64/RHEL/Mythbuntu
Posts: 189

Rep: Reputation: 39
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.
 
Old 11-05-2010, 11:11 PM   #4
aaab
LQ Newbie
 
Registered: Jan 2009
Posts: 4

Original Poster
Rep: Reputation: 0
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.
 
Old 11-06-2010, 12:09 AM   #5
tommylovell
Member
 
Registered: Nov 2005
Distribution: Raspbian, Debian, Ubuntu
Posts: 380

Rep: Reputation: 103Reputation: 103
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.
 
1 members found this post helpful.
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
acoustic management (Hard drive noise problem) fateminasab Linux - Hardware 3 04-24-2009 01:52 PM
Hard Drive Management KeithLeFevre Linux - Newbie 1 01-03-2008 04:20 PM
Not enough hard drive space? doxford Red Hat 1 07-04-2005 01:33 PM
Hard Drive space doralsoral Linux - Software 1 11-08-2003 04:19 PM
Hard Drive Space Odd_Bloke Linux - Newbie 4 09-13-2003 08:44 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 10:02 PM.

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