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

[modules/disk] Use bavail instead of bfree #1004

Merged
merged 1 commit into from
Nov 30, 2023

Conversation

czert
Copy link
Contributor

@czert czert commented Nov 30, 2023

The ext4 filesystem reserves 5 % of disk size. os.statvfs(path).f_bfree reports this reserve as free disk space, while f_bavail considers it "full".

I believe f_bavail gives more useful information, as the reserved space cannot be used. Also, it's in line with what df reports.

@tobi-wan-kenobi
Copy link
Owner

Sounds sensible, many thanks!

@tobi-wan-kenobi tobi-wan-kenobi merged commit e9189c8 into tobi-wan-kenobi:main Nov 30, 2023
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 this pull request may close these issues.

2 participants