• [v6.9-b1] Revert to using df to get free space for btrfs pools


    JorgeB
    • Minor

    I believe it was used before but due to unreliable values it stopped being used, on newer kernels it should work reliably, and better than current method for some situations.

     

    There are frequent posts on the forum from users using two different size devices in a pool, because free space is incorrectly reported and they run out of it, e.g. a pool made of 32GB + 64GB devices default raid1

     

    image.png.5a7ed4d7c36cf482bf59e72fac0451d4.png

     

    Usable space will be around 32GB, GUI reports 47GB, df reports correctly:

     

    image.png.9b0f196dce55cd2f1587c87555d6608a.png

     

    Also starting with even newer kernels, like the one on v6.9-beta1 it started correctly reporting free space for raid5/6 profiles, pool made of four 64GB devices using raid6

     

    image.png.ca3686cbd4a39499d1b66218f7934022.png

     

    With df:

     

    image.png.607207dc0bcffa550f1c900005766cb1.png

     

    Please change this for v6.9, with multiple pools it will likely affect more users.

     

     

    Edited by johnnie.black




    User Feedback

    Recommended Comments

    Code uses the 'statfs()' call which returns

    f_blocks - total blocks

    f_bfree - free blocks in filesystem

    f_bavail - free blocks available to unprivileged user

     

    and we are reporting f_bfree.  We used to report f_bavail (which I think is what it should be) but that didn't work for btrfs; however, in running some tests, it seems it now does report correctly, so that change has been made in next release (beta23).

    • Thanks 2
    Link to comment


    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.
    Note: Your post will require moderator approval before it will be visible.

    Guest
    Add a comment...

    ×   Pasted as rich text.   Restore formatting

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.


  • Status Definitions

     

    Open = Under consideration.

     

    Solved = The issue has been resolved.

     

    Solved version = The issue has been resolved in the indicated release version.

     

    Closed = Feedback or opinion better posted on our forum for discussion. Also for reports we cannot reproduce or need more information. In this case just add a comment and we will review it again.

     

    Retest = Please retest in latest release.


    Priority Definitions

     

    Minor = Something not working correctly.

     

    Urgent = Server crash, data loss, or other showstopper.

     

    Annoyance = Doesn't affect functionality but should be fixed.

     

    Other = Announcement or other non-issue.