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

ZFS free space calculation when there are multiple datasets under the same path #96

Open
DonneyF opened this issue Aug 30, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@DonneyF
Copy link

DonneyF commented Aug 30, 2024

I have the following zpool:

NAME     SIZE  ALLOC   FREE  CKPOINT  EXPANDSZ   FRAG    CAP  DEDUP    HEALTH  ALTROOT
cache    222G  67.4G   155G        -         -     0%    30%  1.00x    ONLINE  -

with the following datasets:

cache                     67.4G   148G     60.6G  /mnt/cache
cache/appdata             1.72G   148G     1.61G  /mnt/cache/appdata
cache/domains               96K   148G       96K  /mnt/cache/domains
cache/system              5.10G   148G     5.07G  /mnt/cache/system

I run YABS on /mnt/cache and encounter the following error:

bash: line 545: ((: 148G: value too great for base (error token is "148G")

The script continues normally afterwards. The issue is that free_space (https://github.com/masonr/yet-another-bench-script/blob/a18e1bcd60f5ab9e3640c650726d8949b7bb5bfe/yabs.sh#L535C3-L535C85) receives the following data:

148G
148G
148G
148

This is because the grep matches all entries. Perhaps a fix would be to also pipe head -n 1 or stricter grep arguments.

@masonr masonr added the bug Something isn't working label Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants