One for those running #ZFS on #Linux systems. I realise that you can’t have hibernate aka suspend to disk on a swap in the encrypted zpool but if you don’t use hibernation then is it OK to use swap using the likes of the command example below to set it up in the encrypted pool?

I should point out that I’m thinking of switching from my current Void Linux luks lvm setup to Void with fully encrypted zpool and zfsbootmenu on my ThinkPad P14s AMD Gen 1which has 16Gb ram that I may upgrade to 40Gb. It also has a 1Tb nvme.

zfs create -V “${v_swap_size}G” -b “$(getconf PAGESIZE)” -o compression=zle -o logbias=throughput -o sync=always -o primarycache=metadata -o secondarycache=none -o com.sun:auto-snapshot=false “$v_rpool_name/swap”

  • MNByChoice@midwest.social
    link
    fedilink
    arrow-up
    10
    arrow-down
    2
    ·
    1 year ago

    ZFS is a large consu6 of RAM. I would think putting swap in ZFS is a terrible idea. I have not checked current recommendations.

  • Chewy@discuss.tchncs.de
    link
    fedilink
    arrow-up
    7
    ·
    edit-2
    11 months ago

    If hibernate isn’t a concern, I’d go with zram. Instead of swapping to a partition/file, zram compresses pages and stores them in RAM. This makes swapping quite fast.

    I’ve not found out how to enable it on Void, but the following app was mentioned on a Void forum.

    https://github.com/atweiden/zramen

  • d3Xt3r@lemmy.nzM
    link
    fedilink
    arrow-up
    6
    ·
    edit-2
    11 months ago

    ThinkPad P14s AMD Gen 1

    Both the laptop and the stock NVMe drive supports Opal2. Not sure about your second drive but if it also supports Opal2, then you should just use that instead of ZFS encryption, since Opal encryption is transparent to the OS, so you won’t have any issues with hibernation.

      • d3Xt3r@lemmy.nzM
        link
        fedilink
        arrow-up
        2
        ·
        11 months ago

        Yes, but the whole point of using Opal2 encryption is that you don’t need to use OS-level FDE/filesystem encryption, thus simplifying your set up.

        Of course, you can still use them if you want to though.

  • antsu@lemmy.wtf
    link
    fedilink
    arrow-up
    3
    ·
    11 months ago

    I don’t have the source right now, but I had the same idea not long ago, and the tl;dr is swap on a zvol is a very bad idea. If your system ever runs low on memory and actually needs to do heavy swapping, you’re setting yourself up for a catastrophe.