!JQvnJacrwKgtkGHYHO:matrix.org

NixOS + Framework

228 Members
Discussing NixOS in the context of the Framework laptop52 Servers

Load older messages


SenderMessageTime
10 May 2026
@albertlarsan68:albertlarsan.frAlbert LarsanI never got a file-based hibernation working on btrfs, that is why I have my onion.14:20:54
@sudoforge:matrix.orgsudoforge

@rajil:rajils.com both of the links you provided are related to using swap (and hibernation) on a zfs zvol.

what we've described here is setting up swap on a secondary (or tertiary) partition, without formatting it as ZFS.

14:23:47
@sudoforge:matrix.orgsudoforge i have file-based swap under encrypted btrfs on my laptop working and don't recall having to do anything special. did you last try this several years ago, perhaps? 14:25:32
@rajil:rajils.comtrumeeyes, i have a separate non-zfs swap partition. But ZFS does not like hibernate, there could be pool corruption.14:25:40
@albertlarsan68:albertlarsan.frAlbert LarsanI tried about two years ago, on a Fedora system (with an Nvidia graphic card). When I made the switch to NixOS (on my current laptop), I decided it wasn’t worth the trouble (especially with impermanence and other stuff)14:30:08
@albert:sysctl.ioAlbertI had success with this guide https://sawyershepherd.org/post/hibernating-to-an-encrypted-swapfile-on-btrfs-with-nixos/ 14:33:18
@sudoforge:matrix.orgsudoforge i'm not sure that's the case; the openzfs disk formatting guide even explicitly instructs users to create a swap partition. 14:33:53
@sudoforge:matrix.orgsudoforge (in case this isn't clear to you trumee - the swap partition is not formatted with zfs and is not a zvol) 15:13:56
@dantefromhell:matrix.orgdantefromhellI've been doing ZFS & swap on a separate partition + hibernate on multiple devices for multiple years w/o pool corruption #DataPoint15:16:27
@rajil:rajils.comtrumeeYes, my swap is ext4.15:16:36
@sudoforge:matrix.orgsudoforgewell that makes sense, since zfs has nothing to do with the swap partition15:16:47
@sudoforge:matrix.orgsudoforge * dantefromhell well that makes sense, since zfs has nothing to do with the swap partition 15:17:17
@sudoforge:matrix.orgsudoforgethen you should be good to go!15:17:40
@rajil:rajils.comtrumeedid you set this up, https://wiki.nixos.org/wiki/ZFS#Partial_support_for_swap_on_ZFS ?15:18:21
@rajil:rajils.comtrumeeWiki does not recommend boot.zfs.allowHibernation = true15:19:05
@sudoforge:matrix.orgsudoforge because this is for hibernation on swap space that is on a zvol 15:19:56
@sudoforge:matrix.orgsudoforgeyou're conflating "i use zfs on /some/partition and have a separate ext4 fs on /another/partition" with "zfs is managing my entire disk"15:20:31
@rajil:rajils.comtrumeeso that option is irrelevant for my ext4 setup i suppose15:20:57
@sudoforge:matrix.orgsudoforgecorrect.15:21:06
@rajil:rajils.comtrumeeso i just need to set boot.resumeDevice ?15:22:07
@sudoforge:matrix.orgsudoforgewell, you need to specify the swap device too. see: https://wiki.nixos.org/wiki/Power_Management#Hibernation15:23:14
@rajil:rajils.comtrumee

do i need to turn off randomEncryption?,

  swapDevices = [    
    {    
      device = "/dev/sda3";    
      randomEncryption.enable = true;    
    } 
15:26:23
@sudoforge:matrix.orgsudoforgeyes; random encryption is not compatible with hibernation, since you don't know the key used to unlock it when you resume15:27:34
@sudoforge:matrix.orgsudoforgeyou can encrypt it with a known key (passphrase, security key, clevis+tang) instead15:28:13
@sudoforge:matrix.orgsudoforgeyou can optionally encrypt it and add the TPM device as a key, allowing you to automatically decrypt it15:28:48
@sudoforge:matrix.orgsudoforge* you can optionally encrypt it and add the TPM device as a key, allowing you to automatically decrypt it. this is inherently less secure, though.15:29:09
@dantefromhell:matrix.orgdantefromhell
In reply to @rajil:rajils.com
did you set this up, https://wiki.nixos.org/wiki/ZFS#Partial_support_for_swap_on_ZFS ?
nope... IIRC when I created my disk layouts (i'm using disko everywhere) swap on zvol was discouraged too
15:29:37
@rajil:rajils.comtrumeei use a yubikey to decrypt on bootup.15:29:57
@sudoforge:matrix.orgsudoforge to decrypt what, though 15:30:23
@sudoforge:matrix.orgsudoforgeyour zfs pool, i'm guessing15:30:39

Show newer messages


Back to Room ListRoom Version: 10