[GH-ISSUE #421] du / dust disagreement #183

Closed
opened 2026-06-08 11:26:01 +03:00 by zhus · 8 comments
Owner

Originally created by @ammaraziz on GitHub (Jul 26, 2024).
Original GitHub issue: https://github.com/bootandy/dust/issues/421

Hi Bootandy,

Thanks for creating and maintaining dust it is excellent piece of software.

I am finding that du disagrees with dust by several TB. Would you have any idea what could be causing the difference?

The commands I am running on the same directory:

sudo du -x -h --max-depth=1 
sudo dust -x -d 1

du agrees with df in regards to the total space used. The difference is something like 4TB of data. I have noticed that dust and du round numbers differently.

Originally created by @ammaraziz on GitHub (Jul 26, 2024). Original GitHub issue: https://github.com/bootandy/dust/issues/421 Hi Bootandy, Thanks for creating and maintaining `dust` it is excellent piece of software. I am finding that `du` disagrees with `dust` by several TB. Would you have any idea what could be causing the difference? The commands I am running on the same directory: ``` sudo du -x -h --max-depth=1 sudo dust -x -d 1 ``` `du` agrees with `df` in regards to the total space used. The difference is something like 4TB of data. I have noticed that `dust` and `du` round numbers differently.
zhus closed this issue 2026-06-08 11:26:01 +03:00
Author
Owner

@wugeer commented on GitHub (Jul 26, 2024):

Hi Bootandy,
Thanks for creating and maintaining dust it is excellent piece of software.
I am finding that du disagrees with dust by several TB. Would you have any idea what could be causing the difference?
The commands I am running on the same directory:

sudo du -x -h --max-depth=1 
sudo dust -x -d 1

du agrees with df in regards to the total space used. The difference is something like 4TB of data. I have noticed that dust and du round numbers differently.

You can try adding the -s parameter. :) image

<!-- gh-comment-id:2251922311 --> @wugeer commented on GitHub (Jul 26, 2024): > > Hi Bootandy, > > Thanks for creating and maintaining `dust` it is excellent piece of software. > > I am finding that `du` disagrees with `dust` by several TB. Would you have any idea what could be causing the difference? > > The commands I am running on the same directory: > > ``` > > sudo du -x -h --max-depth=1 > > sudo dust -x -d 1 > > ``` > > > > > > > > > > > > > > > > > > > > > > > > `du` agrees with `df` in regards to the total space used. The difference is something like 4TB of data. I have noticed that `dust` and `du` round numbers differently. > > You can try adding the -s parameter. :) ![image](https://private-user-images.githubusercontent.com/20339490/352360020-f6bf9d20-578e-4949-9d8d-1260d5a05d9f.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjE5NjY4MjEsIm5iZiI6MTcyMTk2NjUyMSwicGF0aCI6Ii8yMDMzOTQ5MC8zNTIzNjAwMjAtZjZiZjlkMjAtNTc4ZS00OTQ5LTlkOGQtMTI2MGQ1YTA1ZDlmLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MjYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzI2VDA0MDIwMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTU2MTFlMDVlMWQzMTc4YTZkMTlmNDBjYjUxZTczMjg1NGEwNDVjMWE5ZDJmZjk3YmMwMTkwNjliODFlYjc0MjAmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.lXMteUrJeNCOP0kxOkU26JoxPVjYPou6OV0wPPqsCVE)
Author
Owner

@ammaraziz commented on GitHub (Jul 26, 2024):

The -s results in the total size being greater than what I think the total disk space is. So it went from 25T to 35T.

When I use --apparent-size in du, I get a similar value (what I was expecting).

<!-- gh-comment-id:2252023399 --> @ammaraziz commented on GitHub (Jul 26, 2024): The `-s` results in the total size being greater than what I think the total disk space is. So it went from 25T to 35T. When I use `--apparent-size` in `du`, I get a similar value (what I was expecting).
Author
Owner

@wugeer commented on GitHub (Jul 26, 2024):

Can you try du -s and dust -ok?
image
I'm a newer, If this doesn't work, could you provide more information to help me reproduce the issue?

<!-- gh-comment-id:2252405796 --> @wugeer commented on GitHub (Jul 26, 2024): Can you try du -s and dust -ok? ![image](https://github.com/user-attachments/assets/768e2eb5-ee71-4398-93d0-88cab45a36f9) I'm a newer, If this doesn't work, could you provide more information to help me reproduce the issue?
Author
Owner

@ammaraziz commented on GitHub (Jul 26, 2024):

Thank you for all your help.

du -s
421557112
dust -ok
421518688

This is on a directory with no external mounted drives.

<!-- gh-comment-id:2252481341 --> @ammaraziz commented on GitHub (Jul 26, 2024): Thank you for all your help. ``` du -s 421557112 dust -ok 421518688 ``` This is on a directory with no external mounted drives.
Author
Owner

@ammaraziz commented on GitHub (Jul 26, 2024):

Here's system info:
image

Using dust version 1.1.1, du version du (GNU coreutils) 8.25.

architecture is x86_64

<!-- gh-comment-id:2252491592 --> @ammaraziz commented on GitHub (Jul 26, 2024): Here's system info: <img width="402" alt="image" src="https://github.com/user-attachments/assets/501ad78c-0e45-46d2-8ecd-7400a4a806fc"> Using `dust` version `1.1.1`, `du` version `du (GNU coreutils) 8.25`. architecture is x86_64
Author
Owner

@wugeer commented on GitHub (Jul 27, 2024):

Hello, I think I have roughly identified the issue.
On my local machine, there is a directory that contains symlinks to the files.

image

The results of running du -a and dust -ok in this directory are inconsistent. du reports a result of 16, while dust -ok reports 0.

image

The difference is that by default, du considers the size of the symlinked file as 4K, while dust considers the size of the symlinked file as 0.

To calculate the actual size of the symlinked file, you need to add the -L parameter.

image

For your situation, you can try du -s -L and dust -ok -L to check the results. I hope this helps. @ammaraziz

<!-- gh-comment-id:2254162863 --> @wugeer commented on GitHub (Jul 27, 2024): Hello, I think I have roughly identified the issue. On my local machine, there is a directory that contains symlinks to the files. ![image](https://github.com/user-attachments/assets/fbd50b24-1ba7-4b6d-ab5c-79cf9cc58441) The results of running du -a and dust -ok in this directory are inconsistent. du reports a result of 16, while dust -ok reports 0. ![image](https://github.com/user-attachments/assets/433fdb1c-c00e-4c89-8bd0-ebbd14783e86) The difference is that by default, du considers the size of the symlinked file as 4K, while dust considers the size of the symlinked file as 0. To calculate the actual size of the symlinked file, you need to add the -L parameter. ![image](https://github.com/user-attachments/assets/3cd09d68-43ac-4719-b093-327bf45fec5c) For your situation, you can try `du -s -L` and `dust -ok -L` to check the results. I hope this helps. @ammaraziz
Author
Owner

@ammaraziz commented on GitHub (Jul 28, 2024):

Massively helpful thank you wugeer. Feel free to close this when you see fit.

<!-- gh-comment-id:2254472420 --> @ammaraziz commented on GitHub (Jul 28, 2024): Massively helpful thank you wugeer. Feel free to close this when you see fit.
Author
Owner

@bootandy commented on GitHub (Jul 31, 2024):

thanks for your help @wugeer

<!-- gh-comment-id:2259299124 --> @bootandy commented on GitHub (Jul 31, 2024): thanks for your help @wugeer
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: bootandy/archived-dust#183