Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Directories themselves do not contribute to size like they do in du #262

Open
polarathene opened this issue Sep 4, 2024 · 1 comment
Open
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@polarathene
Copy link

polarathene commented Sep 4, 2024

While experimenting with different distro images in Docker, I noticed that du and dua were a bit inconsistent (and later that du itself was inconsistent too with --apparent-size if the version of du was older).

I discovered that dua reported /usr/share/man as only 20KiB, but du was showing about 1MB. This location had many directories nested and most empty. Other locations were like this as well (I had been using zypper --installroot /rootfs install glibc for example to see how much space the package would weigh), contributing several MB in weight invisible to dua for this small glibc package (2.7MB of 10.7MB total). This is due to each directory using a minimum 4096 bytes as the smallest block-size, with a new enough version of du the --apparent-size option will treat these as 0 bytes.

dua has the -A / --apparent-size flag too, but without it directory size seems to still be treated as 0 bytes. Perhaps that is useful for some users vs using dua -A? 🤷‍♂️


The linked discussion comment above suggested to raise an issue about this behaviour since it's technically a bug.

#121 (reply in thread)

It would probably be more correct if dua would also count empty directories as consumer of an inode, which typically clocks in at 4KiB.


It would be neat if dua interactive also supported toggling between --apparent-size btw, which as a bonus would make it available in the TUI help view?

@Byron Byron added bug Something isn't working help wanted Extra attention is needed labels Sep 5, 2024
@Byron
Copy link
Owner

Byron commented Sep 5, 2024

Thanks a lot for reporting!

I think this issue should remain focussed on making the size-on-disk include directories as consumer of a single block.
Supporting the --apparent-size flag for interactive sessions (either interactively or using the flag) should be a separate issue, otherwise it might get lost here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants