du -sh utilization does not match df -h amount used!

Tags:

Answer: 1

11 hours ago

my /var partition is close to 100% full, according to df -h

    [email protected]:/var/lib# df -h
    Filesystem            Size  Used Avail Use% Mounted on
    /dev/sda5             4.7G  600M  3.9G  14% /
    ...
    /dev/sda7             9.3G  8.7G   94M  99% /var

However, when I run a du -sh, I am using less than 2GB!

    [email protected]:/var# du -sh *
    8.0K    autofs
    3.5M    backups
    96M     cache
    1.2G    lib
    4.0K    local
    0       lock
    13M     log
    28K     lost+found
    4.0K    mail
    4.0K    opt
    96K     run
    48K     spool
    4.0K    syslog-ng.persist
    8.0K    tmp
    113M    www
    40K     yp

Is this an Ubuntu 8.04 feature? I have not modified the disk configuration in any way, and I was not the original installer. However, I'd like to know where that other 7GB of disk went, assuming someone has an idea...?

[email protected]:/var# fdisk -l

Disk /dev/sda: 499.9 GB, 499998320640 bytes
255 heads, 63 sectors/track, 60788 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x789298fa

Device Boot         Start         End      Blocks   Id  System
/dev/sda1               1          12       96358+  83  Linux
/dev/sda2              13       60786   488167155    5  Extended
/dev/sda5              13         620     4883728+  83  Linux
/dev/sda6             621        1228     4883728+  83  Linux
/dev/sda7            1229        2444     9767488+  83  Linux <<<<< /var
/dev/sda8            2445        3173     5855661   82  Linux swap / Solaris
/dev/sda9            3174       60786   462776391   83  Linux

I've also checked /usr, yet its math comes up correctly....

Added by: Veda Smitham

Answer: 2

7 hours ago

I am not sure but i have an idea: df means disk free, so it will show you how much of your disk is actually free. du means disk used, so it will show you how much of your disk is actually used. Could it be the case that only 2GB are actually used, but the rest of the space is already reserved for something? I know this problem from ram-related memory statistics, that there is confusion between used/reserved. Not sure with this though.

P.S.: Why exactly are you using a system that is 8 years old? Thats comparable to asking someone why something doesn't work on your windows 2000 machine!

Added by: Letha Herman

Popular Search

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 1 2 3 4 5 6 7 8 9