Find the answer to your Linux question:
Results 1 to 4 of 4
Howzit Folks? I get the following results for various commands and can't figure out what is causing the discrepancy: df -h / Filesystem Size Used Avail Use% Mounted on /dev/sda3 ...
  1. #1
    Just Joined!
    Join Date
    Sep 2004
    Posts
    3

    Discrepancy df/du

    Howzit Folks?

    I get the following results for various commands and can't figure out what is causing the discrepancy:

    df -h /
    Filesystem Size Used Avail Use% Mounted on
    /dev/sda3 2.0G 2.0G 0 100% /

    du -hx --max-depth=1 /
    0 /proc
    12K /mnt
    20K /tmp
    4.0K /opt
    14M /sbin
    0 /sys
    14K /media
    4.0K /selinux
    4.0K /srv
    4.0K /winsys
    4.0K /var
    4.0K /usr
    4.0K /home
    0 /dev
    8.1M /bin
    258M /lib
    18M /lib64
    44M /boot
    16K /lost+found
    24M /root
    44M /etc
    408M /

    Can anyone tell me why there is a difference of 1640 MB between the 2 commands for the root partition?

    Cheers
    Bruce

  2. #2
    Linux Guru gogalthorp's Avatar
    Join Date
    Oct 2006
    Location
    West (by God) Virginia
    Posts
    3,105
    Most likely one gives the actual file size the other the size of all the blocks used. If a file uses even just one byte of a block no other file can use it. So one is good to determine backup size the other the actual space used.

  3. #3
    Linux Newbie
    Join Date
    Mar 2007
    Posts
    139
    Concerning the first output, these cannot be true.

    Size=Used=2.0G cannot have the same value.
    And Available cannot be 0.

    So maybe your system isn't installed properly.
    Anyway, my machines don't produce such strange values.

  4. #4
    Linux Guru
    Join Date
    Jan 2009
    Location
    Dover, NH
    Posts
    1,633
    I'm going to agree with GT. If #files == #inodes, then usage = 100%, regardless of files' actual size total.

    Do you get different results running df as root vs a user? I seem to remember some percentage of inodes are reserved exclusively for root's use, just so if 100% get's used up by a user, the system isn't completely locked out...

    You could run fsck for the statistics.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...