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

Inaccurate Disk Usage Reporting for ext* Filesystems Due to Reserved Blocks #673

Closed
ernolf opened this issue Sep 4, 2024 · 1 comment · Fixed by #674
Closed

Inaccurate Disk Usage Reporting for ext* Filesystems Due to Reserved Blocks #673

ernolf opened this issue Sep 4, 2024 · 1 comment · Fixed by #674

Comments

@ernolf
Copy link
Contributor

ernolf commented Sep 4, 2024

Description:

  • The current implementation inaccurately reports disk usage for ext* filesystems by not accounting for reserved blocks. The df command’s Used-value does not include these reserved blocks, leading to an underestimation of the actual used space. When calculating the file system usage in percent, the calculation is also based on this incorrect basis, which means that the percentages provided by df are inaccurate and therefore actually unusable. Since the 'Blocks' (aka 'Size') value is not used for the actual size of the disk, but the computed sum of 'Used' and 'Available', the same inaccuracy also occur when displaying the actual disk size.
    This affects ext* file systems where a significant part of the disk (default 5%) can be reserved for system and root use.

Expected Behavior:

  • The disk usage should reflect the sum of all blocks that can not be used, which includes reserved blocks, to give an accurate representation of the available space in relation to the real disksize. Users know the size of their devices and get confused, when 5% of disksize is 'missing'.

Ref: https://help.nextcloud.com/t/why-is-my-1tb-ssd-showing-only-890gb-of-usable-space-in-nextcloud/202375/4

@ernolf ernolf added the bug label Sep 4, 2024
@kesselb
Copy link
Collaborator

kesselb commented Sep 4, 2024

Thanks for the report and your debugging work 👍

A pull request that extends the disk object with another value for the total blocks is okay for me.

Taking the reserved blocks into account is out of scope.

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

Successfully merging a pull request may close this issue.

2 participants