Strange Disk Space Calculation Ext4 Df And Du

Home » CentOS » Strange Disk Space Calculation Ext4 Df And Du
CentOS 7 Comments

Hi,

in one server I do have a SSD raid 1 size 219GB.

df shows 9.4 GB free, 198GB used.

If I do “du -sch * | sort -h -r” on /, I just have close to 3.5GB used ….

Any hints, what’s eating up the space?

CentOS 6.6, fs = ext4.

regards . Götz

7 thoughts on - Strange Disk Space Calculation Ext4 Df And Du

  • Deleted files (check out the output of ‘lsof’ and look for deleted files)? This happens a lot when your log rotation system rotates a log but the daemon logging to it isn’t restarted or told to use the new log files.

    Also, you could have sparse files (read the man page for ‘du’ under
    –apparent-size) that appear to be using more space than ‘du’ normally reports.

  • The ext[234] filesystems reserve a certain amount of space for use by root only. If I remember correctly, the default if 5%, but you can tune that with tune2fs(8) or mkfs.ext4(8). The df command subtracts the reserved space when it shows the amount free. So an empty 1GB filesystem would show as having 950 MB free.

    Hope that helps

  • Am 03.11.14 um 19:54 schrieb Jonathan Billings:

    Hi, I checked your suggestions but still no clue what might be “wrong”.

    lsof reports just two DEL Files “sshd …. /dev/zero” and a du with
    –apparent-size shows the same result.

    still wondering … Regards . G

  • Am 04.11.14 um 08:45 schrieb Rick Thomas:

    Hi thanks, I’m aware of that, and in my case that would be as if 95% are reserved for root. Currently I “miss” 195 +- GB ….

    Regards . G

  • Next thing to check is stuff hiding under mount points. That is for example the /tmp directory on the root fs containing stuff but another fs then mounted on /tmp hiding that.

    /Peter

  • Am 04.11.14 um 09:43 schrieb Peter Kjellström:

    df -h

    Filesystem Size Used Avail Use% Mounted on
    /dev/mapper/vg_richter2-lv_root
    219G 198G 9,3G 96% /
    tmpfs 16G 0 16G 0% /dev/shm
    /dev/sda1 477M 49M 403M 11% /boot
    /dev/sdb 8,2T 1,1T 7,1T 14% /srv/files

    so I dont see any hidden fs under / beside /srv/files, which is not included in my du calculation.

    Thanks and regards for more hints … /Götz