unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* I installed guix with a swap and ... my swap disappeared
@ 2024-03-10 20:58 jean-michel.colin--- via
  2024-03-16 14:29 ` Tobias Geerinckx-Rice
  0 siblings, 1 reply; 2+ messages in thread
From: jean-michel.colin--- via @ 2024-03-10 20:58 UTC (permalink / raw)
  To: help-guix


Hello everybody,



my first post here, I come from NixOS but as a lisper it's much more consistent for me to use Guix.



So I installed guix on an encrypted ext4 device, from the graphic installer, including a swap.

The first time, everything worked, including the swap. 

Until I suspended (one of the purpose of the swap). 

I was not able to recover from the suspended session from the swap, I had to open a new session, and ... the swap had disappeared.



From my config.scm :

(bootloader (bootloader-configuration
                (bootloader grub-bootloader)
                (targets (list "/dev/sda"))
                (keyboard-layout keyboard-layout)))
  (swap-devices (list (swap-space
                        (target (uuid
                                 "here-the-uuid-numebrs-and-letters")))))
  (mapped-devices (list (mapped-device
                          (source (uuid
                                   "here-the-uuid-numebrs-and-letters"))
                          (target "crypthome")
                          (type luks-device-mapping))
                        (mapped-device
                          (source (uuid
                                   "here-the-uuid-numebrs-and-letters"))
                          (target "cryptroot")
                          (type luks-device-mapping))))



some tests I made :

swapon --show
==> no result

cat /proc/swaps
==> no result (except the headers Filename Type etc)

sudo fdisk --list | grep swap
==> /dev/sda3 206301184 225851391 19550208 9.3G Linux swap
==> this is the swap I created, and worked fine right after the install, never again after

sudo herd log | grep swap
==> 4 Mar 2024 19:08:05 service swap-74e19e9d-3bba-4154-881f-0c5ad076254b is being started
4 Mar 2024 19:08:05 service swap-74e19e9d-3bba-4154-881f-0c5ad076254b failed to start





What have I done wrong ?

Should I build again from scratch on another filesystem ? btrfs ?

Tks








^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: I installed guix with a swap and ... my swap disappeared
  2024-03-10 20:58 I installed guix with a swap and ... my swap disappeared jean-michel.colin--- via
@ 2024-03-16 14:29 ` Tobias Geerinckx-Rice
  0 siblings, 0 replies; 2+ messages in thread
From: Tobias Geerinckx-Rice @ 2024-03-16 14:29 UTC (permalink / raw)
  To: jean-michel.colin, jean-michel.colin--- via, help-guix

Hi Jean-Michel,

Try running

# sudo mkswap /dev/sda3

to recreate the swap area.  In fact, run it now before continuing.  See the last paragraph.

I think that both of your problems have the same cause, and one that's easily fixed.

To resume from hibernation, Linux needs to be told where the hibernation image was stored.  It does not do this by itself.  It also won't erase stale hibernation images, which is why you can't swapon.

You need to add

(kernel-arguments (list "resume=/dev/sda3"))

to your system configuration, or append that string to the list if you already have a kernel-arguments field.  Then reconfigure for the boot loader to be updated.

Passing "resume=here-the-uuid-numbers-and-letters" instead of a device file name *should* also work, but it's not something I heavily tested since adding hibernation support.  I've always used device file names.

Until you can successfully hibernate and resume, you MUST run that mkswap at the top of this message after each failed attempt.  You risk total corruption of all mounted file systems if you don't.

Kind regards,

T G-R

Sent on the go.  Excuse or enjoy my brevity.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-03-16 14:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-10 20:58 I installed guix with a swap and ... my swap disappeared jean-michel.colin--- via
2024-03-16 14:29 ` Tobias Geerinckx-Rice

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).