Jump to content
  • 6.8.0-rc3 cannot enable swapfile

    • Closed

    BTRFS on kernel5.x supports swapfiles located on the partition.


    The current version is not able to use a swapfile


    commands to create:

    cd /mnt/cache
    truncate -s 0 swapfile
    chattr +C swapfile
    fallocate -l 16G swapfile
    chmod 0600 swapfile
    mkswap swapfile
    swapon swapfile
    cat /proc/swaps



    root@whitebox:~# cd /mnt/cache/
    root@whitebox:/mnt/cache# truncate -s 0 swapfile
    root@whitebox:/mnt/cache# chattr +C swapfile
    root@whitebox:/mnt/cache# chattr +C swapfile
    root@whitebox:/mnt/cache# fallocate -l 16G swapfile
    root@whitebox:/mnt/cache# chmod 0600 swapfile
    root@whitebox:/mnt/cache# mkswap swapfile
    Setting up swapspace version 1, size = 16 GiB (17179865088 bytes)
    no label, UUID=c19590a0-0270-4d5d-b96f-b3fa50d93756
    root@whitebox:/mnt/cache# swapon swapfile
    swapon: /mnt/cache/swapfile: swapon failed: Invalid argument
    root@whitebox:/mnt/cache# swapon -a swapfile
    swapon: /mnt/cache/swapfile: swapon failed: Invalid argument
    root@whitebox:/mnt/cache# cat /proc/swaps
    Filename                                Type            Size    Used    Priority


    User Feedback

    Recommended Comments

    Since you didn't post diags I don't know if you have multi-device cache pool (which won't work)... You got this far, keep googling until you figure it out.

    Share this comment

    Link to comment
    Share on other sites

    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.

    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.