Df -h does not tally

 
Thread Tools Search this Thread
Top Forums UNIX for Beginners Questions & Answers Df -h does not tally
# 1  
Old 09-26-2017
Df -h does not tally

Hi,

My df -h numbers do not tally.

Code:
desind@abc123:~#> df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/xvda1       99G  6.9G   87G   8% /
tmpfs            16G     0   16G   0% /dev/shm
/dev/xvdi        50G   53M   47G   1% /home
/dev/xvdb       985G   72M  935G   1% /kafka/data/sda
/dev/xvdc       985G   19G  916G   3% /kafka/data/sdb
/dev/xvdd       985G   19G  916G   3% /kafka/data/sdc
/dev/xvde       985G   76G  859G   9% /kafka/data/sdd
/dev/xvdj        20G   44M   19G   1% /abv/monitoring
/dev/xvdf        69G  3.1G   63G   5% /cxt/sfw
/dev/xvdl       7.8G   19M  7.4G   1% /tmp
/dev/xvdg       9.8G  3.1G  6.2G  34% /var
/dev/xvdh        50G  205M   47G   1% /var/log
cm_processes     16G  168M   16G   2% /var/run/cloudera-scm-agent/process
/dev/xvdk        79G  214M   75G   1% /fgv/pep

I am concerned about the /kafka/data/* directories.

for example /kafka/data/sdd the used column is incorrect.

i did a du and the number still says 76G

Code:
desind@abc123:/kafka/data/sdd#> sudo du -sh
76G

If total size is 985G and used is 76G, then the available disk must be 909G

Is this a bug in redhat linux 6.7 ? can i check that is the exact usage ?

Last edited by desind; 09-26-2017 at 03:15 PM.. Reason: code tags
# 2  
Old 09-26-2017
# 3  
Old 09-26-2017
There may exist on disk deleted files which are still held open by a program. They can't be removed from disk until they are closed. A common culprit is log files; new admins may try to cull log files by deleting them, and discover that the space is not freed, because the files are still held open by the programs writing to them...
# 4  
Old 09-26-2017
i did check for deleted files

Code:
sudo lsof | grep -i deleted
python     2457               root  txt       REG              202,1       4864     528849 /usr/lib64/cmf/agent/build/env/bin/python (deleted)
python     2457               root   13w      REG            202,176          0         13 /tmp/cmflistener-stderr---agent-2292-1492523969-B5XEZS.log (deleted)


these are very small files. let me check further
# 5  
Old 09-26-2017
Also note that inodes use space. Space for inodes has to be set aside when formatting the filesystem and is "lost" for file storage. The same is true (although to a smaller extent) for other filesystem structures: superblock, journals (with journaling FSes), ....

I hope this helps.

bakunin
# 6  
Old 09-27-2017
To second what bakunin said: with 72M the usage of /dev/xvdb is close to zero and thus negligible, leaving a net capacity of 935G after having lost the space for file system's meta data. Based on that number, the rest of the disks' used space seems to be in a linear relationship.
Aside: All of your disks seem to lose roughly 5% of their capacity to the file systems' data structures.
This User Gave Thanks to RudiC For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread
Login or Register to Ask a Question