Subject: bug#62711: Suspend-to-disk with LUKS-encrypted root doesn’t work

From: Mekeor Melire <[email-masked]>
Date: Fri, 07 Apr 2023 21:20:39 +0000

2023-04-07 14:42 [email-masked]:

> Since my laptop’s battery died, I set up suspend-to-disk as 
> documented
> in the manual (info "(guix) Swap Space").  I use a swap file on 
> top of
> my LUKS-encrypted root partition, so I added:
>
>      "resume=/swap"
>      "resume_offset=OFFSET"

I use the following configuration which works fine for me. (Except 
sometimes I have to wait for 2-3 minutes for the Linux kernel 
modules to get loaded; but that might be due to the special Linux 
kernel I'm using.)

#+begin_src scheme
(mapped-devices
  (list
    (mapped-device
      (source
        (uuid "SNIP"))
      (target "cryptroot")
      (type luks-device-mapping))))

(file-systems
  (cons
    (file-system
      (mount-point "/")
      (device "/dev/mapper/cryptroot")
      (type "ext4")
      (dependencies mapped-devices))
    %base-file-systems))

(kernel-arguments
  (cons*
    "resume=/dev/mapper/cryptroot"
    "resume_offset=5308416"
    %default-kernel-arguments))
#+end_src