this post was submitted on 13 Dec 2023
4 points (83.3% liked)

Everything ZFS

275 readers
1 users here now

A community for the ZFS filesystem.

ZFS is an opensource COW filesystem used by enterprise and serious homelabbers for it's data safety and extensive feature set.

OpenZFS is the active branch now developed primarily for Linux with a port to it's FreeBSD roots.

This community is here to answer questions and discuss topics related to the use of ZFS in the wild.

Rules:

As always, the main rule is Don't Be a Dick. Be polite with new users asking questions that you may consider obvious. If you don't have something constructive to offer, downvote and move on.

No dirty deletes: your posts are here for posterity, perhaps the next person will get something out of it, even if it's wrong.

founded 1 year ago
MODERATORS
4
submitted 11 months ago* (last edited 11 months ago) by JustineSmithies to c/zfs
 

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"

top 2 comments
sorted by: hot top controversial new old
[โ€“] [email protected] 2 points 11 months ago* (last edited 11 months ago)

I haven't used swap on zvol myself, but I've read about issues in low-memory situations, like this one: https://github.com/openzfs/zfs/issues/7734

To write to swap, zfs needs to allocate ARC memory. But to do that, it would need to write to swap...

Consider using zramswap, that's probably the easiest solution.

[โ€“] [email protected] 2 points 5 months ago

You shouldn't use swap on zvol in Linux at all. It will lead to dead lock when high memory pressure. See also https://github.com/openzfs/zfs/issues/7734