unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* Declare swap partition in config
@ 2019-09-13 15:47 w96k
  2019-09-13 16:15 ` Julien Lepiller
  0 siblings, 1 reply; 5+ messages in thread
From: w96k @ 2019-09-13 15:47 UTC (permalink / raw)
  To: help-guix

Is there any way to declare swap in config.scm without using swapon 
directly?

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

* Re: Declare swap partition in config
  2019-09-13 15:47 w96k
@ 2019-09-13 16:15 ` Julien Lepiller
  0 siblings, 0 replies; 5+ messages in thread
From: Julien Lepiller @ 2019-09-13 16:15 UTC (permalink / raw)
  To: help-guix, w96k

Le 13 septembre 2019 17:47:27 GMT+02:00, w96k@posteo.net a écrit :
>Is there any way to declare swap in config.scm without using swapon 
>directly?

In the mamual, I see operating-system has a swap-devices field. I think that's what you need :)

http://guix.gnu.org/manual/en/html_node/operating_002dsystem-Reference.html#operating_002dsystem-Reference

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

* Re: Declare swap partition in config
@ 2022-02-26 23:38 Antwane Mason
  2022-02-26 23:52 ` Tobias Geerinckx-Rice
  0 siblings, 1 reply; 5+ messages in thread
From: Antwane Mason @ 2022-02-26 23:38 UTC (permalink / raw)
  To: help-guix

For some reason, my guix system is not detecting my swap partition despite
it being configured in my config. However, performing swapon directly does
activity the partition. Is there an issue in my configuration? I am using
the newer "swap-space" data structure for swap due to generating it from
the installer a week ago.

Here is my swap device name and uuid from blkid:

/dev/nvme0n1p4: UUID="b7c057f7-c090-4a09-a94b-f92e66bdaebc"
TYPE="swsuspend" PARTUUID="65db7a7a-62bf-42de-b1c4-094e9fac6090"

Here is my swap-devices value for my config:

(swap-devices
    (list (swap-space
            (target
              (uuid "b7c057f7-c090-4a09-a94b-f92e66bdaebc")))))

Regards,
Antwane

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

* Re: Declare swap partition in config
  2022-02-26 23:38 Declare swap partition in config Antwane Mason
@ 2022-02-26 23:52 ` Tobias Geerinckx-Rice
  2022-02-27 23:51   ` Antwane Mason
  0 siblings, 1 reply; 5+ messages in thread
From: Tobias Geerinckx-Rice @ 2022-02-26 23:52 UTC (permalink / raw)
  To: Antwane Mason; +Cc: help-guix

On 2022-02-27 0:38, Antwane Mason wrote:
> TYPE="swsuspend"

You can only swapon(2) swap partitions.  Run

   $ sudo mkswap /dev/nvme0n1p4

and reboot, and it should work just fine.

swapon(8) does a lot more than merely call swapon(2), including 
overwriting any SWSUSPEND signature[0].

Guix does not do this.

It could, either at the expense of code manually kept in sync with 
util-linux, or by embedding a copy swapon(8) in the initrd, enlarging 
it.

Kind regards,

T G-R

Sent from a Web browser.  Excuse or enjoy my brevity.

[0]: 
https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git/tree/sys-utils/swapon.c#n371


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

* Re: Declare swap partition in config
  2022-02-26 23:52 ` Tobias Geerinckx-Rice
@ 2022-02-27 23:51   ` Antwane Mason
  0 siblings, 0 replies; 5+ messages in thread
From: Antwane Mason @ 2022-02-27 23:51 UTC (permalink / raw)
  To: Tobias Geerinckx-Rice; +Cc: help-guix

Tobias,

Thank you for your help! You were right that the partition type was the
problem.

Calling mkswap did not change the partition's type,  but deleting and
recreating the partition with the swap type worked. I had to change my
config with the new partition's UUID and then do system reconfigure.

Now, my swap partition is activated on start as expected!

Regards,
Antwane


On Sat, Feb 26, 2022 at 6:52 PM Tobias Geerinckx-Rice <me@tobias.gr> wrote:

> On 2022-02-27 0:38, Antwane Mason wrote:
> > TYPE="swsuspend"
>
> You can only swapon(2) swap partitions.  Run
>
>    $ sudo mkswap /dev/nvme0n1p4
>
> and reboot, and it should work just fine.
>
> swapon(8) does a lot more than merely call swapon(2), including
> overwriting any SWSUSPEND signature[0].
>
> Guix does not do this.
>
> It could, either at the expense of code manually kept in sync with
> util-linux, or by embedding a copy swapon(8) in the initrd, enlarging
> it.
>
> Kind regards,
>
> T G-R
>
> Sent from a Web browser.  Excuse or enjoy my brevity.
>
> [0]:
>
> https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git/tree/sys-utils/swapon.c#n371
>

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

end of thread, other threads:[~2022-02-28  0:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-26 23:38 Declare swap partition in config Antwane Mason
2022-02-26 23:52 ` Tobias Geerinckx-Rice
2022-02-27 23:51   ` Antwane Mason
  -- strict thread matches above, loose matches on Subject: below --
2019-09-13 15:47 w96k
2019-09-13 16:15 ` Julien Lepiller

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).