The du command is a standard tool for checking disk usage on Linux and Unix systems. But, users running Ubuntu 25.10 have noticed something odd. When calculating directory sizes, the modern Rust-based uutils du tool shows incorrect disk usage when parent and subdirectories overlap in Ubuntu 25.10.
Users report that the uutils du command miscalculates directory sizes due to double counting and the totals seem too high compared to the classic GNU coreutils version.
Table of Contents
-
[An Argument Ordering Problem](#An_Argument_…
The du command is a standard tool for checking disk usage on Linux and Unix systems. But, users running Ubuntu 25.10 have noticed something odd. When calculating directory sizes, the modern Rust-based uutils du tool shows incorrect disk usage when parent and subdirectories overlap in Ubuntu 25.10.
Users report that the uutils du command miscalculates directory sizes due to double counting and the totals seem too high compared to the classic GNU coreutils version.
Table of Contents
The Double Counting Trap
The uutils coreutils project aims to rewrite standard Linux utilities using the Rust programming language. Its primary goal is to be a drop-in replacement for the traditional GNU tools. Consequently, developers treat any behavioral differences compared to GNU as a bug.
The current problem appears when you ask du to check two overlapping directories at once.
A user on the AskUbuntu forum reported that the new du command from Rust uutils is producing incorrect file size outputs in Ubuntu 25.10.
He tried to check both a parent directory and one of its subdirectories in a single command, like /var and /var/log. The GNU version handled it smoothly and printed the correct size, but uutils failed.
Example:
In a related GitHub issue, the same user provided a simple test case showing a directory with a total size of 15 MiB, where one of its subdirectories contains 5 MiB of data.
- The Correct Total (GNU): The GNU version correctly calculates the total usage as 15 MiB. It counts the files in the subdirectory only once.
- The Incorrect Total (uutils v0.2.2): The
uutilsversion reports the total usage as 20 MiB. It essentially adds the subdirectory’s size to the parent directory’s size, counting those internal files twice.
This discrepancy happens because uutils adds up the individual arguments without confirming if it has already counted that data.
An Argument Ordering Problem
This issue is largely an argument ordering problem that relates to how the program handles overlapping data.
When checking multiple directories, the traditional GNU du command and utilities like Busybox actually change their output depending on the order you list the directories. Yet, even when they change their specific per-directory output, GNU and Busybox agree on the correct final total size.
Interestingly, the Rust-based uutils du (version 0.2.2) remains consistent regardless of the argument order. It produces the same, but still incorrect, inflated total size every time.
This suggests that uutils does not properly check for files or directories that have already been summed up.
Some users have even suggested that the Rust utility might not be performing proper link counting, which could cause the summation errors.
The POSIX Standard Backs the Fix
Another user in the same AskUbuntu thread shared a different perspective on this issue.
For many years, file system standards offered confusing guidance on this issue.
- The older 2018 POSIX standard noted that counting files that appeared under multiple directories was implementation-defined. Different tools could choose different behaviors.
- But, the newer 2024 POSIX edition eliminated this confusion. This standard now requires that a file must be counted and reported only for one entry. This means the GNU behavior, counting the contents only once, is now the required standard.
Since uutils explicitly aims to match GNU’s output exactly, this double-counting behavior is recognized as a genuine incompatibility bug.
Current Status: The Bug is Open!
Developers acknowledge this double-counting issue as an incompatibility bug. It definitely violates the project’s main goal: matching GNU’s output exactly.
- Status: This is an Open issue.
- Tracking: The bug is currently being tracked on GitHub as Issue #9202.
- Fix Progress: As of writing this post, there are no branches or pull requests linked to Issue #9202. So I think a direct fix is still being developed.
Temporary Workaround
If you are using a version of du based on uutils coreutils (like version 0.2.2 or similar in new Ubuntu releases), you should avoid using overlapping directories in a single du invocation.
To get the accurate total size of a parent directory, simply run the command on the parent directory alone. For example, to check the size of /var, just use:
du -smc /var
This ensures you get the correct summary of the whole size of /var, matching what the GNU version provides.
Stay tuned with us for more updates as the Rust uutils team works hard to make their coreutils the perfect drop-in replacement we all need.
sk
Senthilkumar Palani (aka SK) is the Founder and Editor in chief of OSTechNix. He is a Linux/Unix enthusiast and FOSS supporter. He lives in Tamilnadu, India.