0

See inconsistency in disk usage value between df & du unix command output on mount-drive.

Here is sample result from df -k command output on a mount point.

df -k /mount/point | awk '{print $3}'
Used
245661696

If we calculate K block to bytes then its : 245661696 * 1024 = 251557576704

Here is sample result from du command output on a mount point main directory (mount point itself)

du -b --max-depth=0 /mount/point
375628722011

du output : 375628722011 which is almost 124GB extra when compared with df output!

Am I missing something. Some real time result from du will always be different?

Jaleks
  • 2,499
  • 1
  • 17
  • 34
vinWin
  • 109
  • 1
  • 1
    @vinWin I-'m not sure this is related but look at my question since 2014 here:https://unix.stackexchange.com/questions/140473/why-does-df-h-show-out-of-sync-space-used – somethingSomething Sep 05 '22 at 15:39
  • 4
    This has been discussed to death here. – Artem S. Tashkinov Sep 05 '22 at 16:32
  • thanks for pointers. I tried with `-x` option of `du` to see if it yields _correct_ result, but I am afraid its not. I also looked at `stat --file-system $HOME` yielding to 4096 , but wasn't clear how it computes up for my conversion. All I need is correct output bytes from `du` so that I can convert to GB/TB. Any help to solve this mystry much appreciated.. – vinWin Sep 08 '22 at 14:52

0 Answers0