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

Discrepancy between df and duf on macOS #205

Open
sryze opened this issue Oct 16, 2022 · 3 comments · May be fixed by #208
Open

Discrepancy between df and duf on macOS #205

sryze opened this issue Oct 16, 2022 · 3 comments · May be fixed by #208

Comments

@sryze
Copy link

sryze commented Oct 16, 2022

When I run duf on a MacBook (macOS 12.6, APFS) it shows different info for some of the system volumes compared to the info printed by df, e.g. "Used" space of /System/Volumes/Preboot and /System/Volumes/VM .

df output:

Screen Shot 2022-10-16 at 19 37 53

duf:

Screen Shot 2022-10-16 at 19 37 46

@Lan-ce-lot
Copy link

Lan-ce-lot commented Oct 20, 2022

I found the same problem on my MacBook(macOS 12.51, APFS) too.

df -h
截屏2022-10-20 21 07 52
duf
截屏2022-10-20 21 08 13

In the df, Used+Avail ≤ Size
But in the duf, Used+Avail == Size
So the df might be the problem?

@sryze
Copy link
Author

sryze commented Oct 21, 2022

As far as I understand, the free space of an APFS container is shared between all volumes of that container and can be allocated to them on demand, therefore used + available space will not be equal to total size for its volumes.

@sryze
Copy link
Author

sryze commented Oct 21, 2022

I found that the information about a volume's used space is provided by the getattrlist() system call, but it's not implemented in Go yet. This is what df uses internally for the "Used" column.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants