Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 05-12-2011, 10:01 AM   #1
LQ Newbie
Registered: Apr 2011
Posts: 13

Rep: Reputation: 0
Wrong disk usage

Hi everybody,

I have a strange problem regarding disk usage on a CentOS plain box.

df command shows 75GBs used..

[]df -ah
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda4             121G   75G   40G  66% /
proc                     0     0     0   -  /proc
sysfs                    0     0     0   -  /sys
devpts                   0     0     0   -  /dev/pts
/dev/sda2             9,7G  154M  9,1G   2% /tmp
/dev/sda1              99M   24M   71M  25% /boot
tmpfs                 2,0G     0  2,0G   0% /dev/shm
none                     0     0     0   -  /proc/sys/fs/binfmt_misc
But du command shows only 23 GBs:

[]du -shc /
23G	/
23G	total

[]du -shc /*
8,0M	/bin
18M	/boot
136K	/dev
65M	/etc
624M	/home
328M	/lib
18M	/lib64
16K	/lost+found
8,0K	/media
8,0K	/misc
954M	/mnt
8,0K	/opt
242M	/php-cache
0	/proc
888K	/root
33M	/sbin
8,0K	/selinux
4,0K	/service
8,0K	/srv
0	/sys
3,3M	/tmp
1,5G	/usr
20G	/var
23G	total
Other disk info that may help:

[]fdisk -l

Disk /dev/sda: 146.1 GB, 146163105792 bytes
255 heads, 63 sectors/track, 17769 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          13      104391   83  Linux
/dev/sda2              14        1318    10482412+  83  Linux
/dev/sda3            1319        1579     2096482+  82  Linux swap / Solaris
/dev/sda4            1580       17769   130046175   83  Linux

[]cat /etc/fstab
LABEL=/                 /                       ext3    defaults        1 1
LABEL=/tmp              /tmp                    ext3    defaults        1 2
LABEL=/boot             /boot                   ext3    defaults        1 2
tmpfs                   /dev/shm                tmpfs   defaults        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0
LABEL=SWAP-sda3         swap                    swap    defaults        0 0
What is wrong here? Am I missing something?
What's the real usage for / ? 23 or 75 gb?

Old 05-12-2011, 11:12 AM   #2
Registered: Feb 2008
Distribution: Slackware
Posts: 595

Rep: Reputation: 115Reputation: 115

du looks at the files and sums them up. df is a filesystem overview.

The report from df doesn't take account of certain things such as deleted files still being held open by running processes.

Lots of info around for googling.
Old 05-12-2011, 09:53 PM   #3
LQ Guru
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,411

Rep: Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397
There are 4 things to read up on in detail if you really want the gory truth - see -m flag - powers of 10 (manufacturers claims) vs powers of 2 (real computers)

It's one of those 'simple' qns with a complex answer.
See also load avgs, RAM usage for similar issues.
Old 05-13-2011, 06:35 AM   #4
LQ Newbie
Registered: Apr 2011
Posts: 13

Original Poster
Rep: Reputation: 0
Thanks! After rebooting up the server, the disk usage went normal and shows the same as du -sh

Thanks a lot for all the suggestions!


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
[SOLVED] Wrong space usage! badihi Linux - General 5 03-24-2011 12:19 PM
Disk Usage Analyzer reports too much disk space? ler0nldb2 Linux - Newbie 1 09-12-2009 11:27 AM
Wrong disk free space (VERY wrong) macrojd Linux - Server 12 05-17-2009 03:14 AM
df reports wrong disk usage Mathieu_G Linux - General 4 04-13-2005 03:44 PM
101% disk usage on an empty disk tsiuser Linux - Software 3 01-28-2004 07:24 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:30 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration