View previous topic :: View next topic |
Author |
Message |
WWWW Tux's lil' helper
Joined: 30 Nov 2014 Posts: 143
|
Posted: Mon Nov 16, 2015 7:09 pm Post subject: du 4GB discrepancy (anecdote) |
|
|
hello,
Trying to find size of folders under billy gate$$$ M$$ I get wildly differing measures:
Code: |
du -sh Windows/* | sort -h
16G Windows/winsxs
|
and
Code: |
du -sh Windows/winsxs/
20G Windows/winsxs/
|
What accounts the 4GB discrepancy? I mean, because now I am only deleting, but I was wondering in some critical app having such a difference value could cause an expensive EN'SAY satellite to de-orbit.
Is this a du or ntfs under linux problem? Although those files aren't really necessary but this wide range in gigas piqued my curiosity.
The winsxs being 16-20GB size is another entirely different WTF off-topic for official m$$ forums.
thanks
p.s.: happens as well with -s option alone (without -h). Just to rule out some sum errors between utilities. |
|
Back to top |
|
|
krinn Watchman
Joined: 02 May 2003 Posts: 7470
|
Posted: Tue Nov 17, 2015 7:30 am Post subject: |
|
|
Code: | -d, --max-depth=N
print the total for a directory (or file, with --all) only if it
is N or fewer levels below the command line argument;
--max-depth=0 is the same as --summarize
|
So because of -s --max-depth is 0
from Windows : winsxs is depth0, winsxs/thatdir is depth1 -> thatdir is not count
from Windows/winsxs : thatdir is depth0
I think it answer you size of winsxs with its file in the first case
and the second one, it answer you size of winsxs with all 1 level subdirectory
Yeah, it mean, even your second answer doesn't really answer you what is the size of winsxs because you might have winsxs/thatdir/again_a_dir and they won't be count), so winsxs may be even bigger than 20G
Avoid using -s if you want good answer
And if your second question is "but why the hell du is doing that?"
Its manpage would answer you again
du - estimate file space usage |
|
Back to top |
|
|
Ant P. Watchman
Joined: 18 Apr 2009 Posts: 6920
|
Posted: Sat Nov 21, 2015 7:29 pm Post subject: |
|
|
The most logical explanation is that the directory itself is 4GB in size. Might make sense if it has thousands of files with ACLs and ADSs attached. Windows NT isn't exactly known for stellar filesystem efficiency. |
|
Back to top |
|
|
|