I am seeing some very strange results when using du
on some of my folders.
For example:
#cd /storage/main_folder
#du -h --max-depth=2 subfolder1 | grep subfolder2
1.8G subfolder1/subfolder2/subfolder31
5.3G subfolder1/subfolder2/subfolder32
352M subfolder1/subfolder2/subfolder33
76K subfolder1/subfolder2/subfolder34
1.8G subfolder1/subfolder2/subfolder35
4.0M subfolder1/subfolder2/subfolder36
301M subfolder1/subfolder2/subfolder37
9.4G subfolder1/subfolder2
# du -h --max-depth=1 subfolder1/subfolder2
1.8G subfolder1/subfolder2/subfolder31
5.3G subfolder1/subfolder2/subfolder32
352M subfolder1/subfolder2/subfolder33
96G subfolder1/subfolder2/subfolder34
1.8G subfolder1/subfolder2/subfolder35
4.0M subfolder1/subfolder2/subfolder36
301M subfolder1/subfolder2/subfolder37
106G subfolder1/subfolder2
As far a I can tell, there are no links or special files in subfolder2
. The disk is a local RAID volume, ext4, mounted with rw,noatime,nodiratime,stripe=64
.
What could be causing this, and what can I do to fix the problem, and get the correct results?
Thank you!
[ Edit, because I received a link to this question : I am aware of apparent size vs block size. But in this case, note that:
subfolder34
shows up as 76K in one output, and 96G in the other. Too big a difference to be explained by apparent size...- I am using the exact same
du
command, the only difference is the working directory when running the command. So we can exclude differences due to the way different utilities compute sizes ]
/storage/main_folder/subfolder1/subfolder2
, yet getting widely different results.du
report such a huge difference for the exact same folder? (notice that it is the exact samesubfolder34
in both outputs - the only difference is the working dir when running the command). Don't get me wrong - I truly appreciate your comments, and thank you for them! It's just that I cannot wrap my head around this, and this is why I keep asking add'l questions.