From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id yLeNC4vlUWFCEAAAgWs5BA (envelope-from ) for ; Mon, 27 Sep 2021 17:38:51 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id QJxTB4vlUWGeRAAAB5/wlQ (envelope-from ) for ; Mon, 27 Sep 2021 15:38:51 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 70E71170C3 for ; Mon, 27 Sep 2021 17:38:50 +0200 (CEST) Received: from localhost ([::1]:54156 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mUsiP-0008Ub-KT for larch@yhetil.org; Mon, 27 Sep 2021 11:38:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59656) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mUshe-00086a-RL for bug-guix@gnu.org; Mon, 27 Sep 2021 11:38:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:59106) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mUshe-00005E-Jk for bug-guix@gnu.org; Mon, 27 Sep 2021 11:38:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mUshe-0003ew-HK for bug-guix@gnu.org; Mon, 27 Sep 2021 11:38:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#50788: Swapfile on Btrfs does not start at boot Resent-From: Zacchaeus Scheffer Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Mon, 27 Sep 2021 15:38:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50788 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Brice Waegeneire Received: via spool by 50788-submit@debbugs.gnu.org id=B50788.163275704613996 (code B ref 50788); Mon, 27 Sep 2021 15:38:02 +0000 Received: (at 50788) by debbugs.gnu.org; 27 Sep 2021 15:37:26 +0000 Received: from localhost ([127.0.0.1]:42416 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mUsh3-0003df-GJ for submit@debbugs.gnu.org; Mon, 27 Sep 2021 11:37:26 -0400 Received: from mail-ed1-f44.google.com ([209.85.208.44]:33660) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mUsgx-0003d5-6W for 50788@debbugs.gnu.org; Mon, 27 Sep 2021 11:37:24 -0400 Received: by mail-ed1-f44.google.com with SMTP id b26so22609298edt.0 for <50788@debbugs.gnu.org>; Mon, 27 Sep 2021 08:37:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=LEAS/HhG/25l7wJdkmzeFAACfnG9p71axOsaesLOHos=; b=XvzrBJ9xZrC/aRgu29bOswvqHBmEy7u7/zGtlM4PbXAuHIVvGmedAvm932qmQacXDY qVJ2HWSdKMdfBq2URWrWuCnb4Y0yYkT4/STtAmYpL/PnwgJKF6cdQVVadN43wYohhY9J /nqDZ1r5MNcx/dQUSgtfR9Ieq0LxnNySMMMJUwI/gCWrtkNiROGfbzHjtThLiBBez9ue UVN1/VNDzACGy7x7zJlXVDNeMNGCvaSanKYaTv2t07MwoatoZJ1OHMe7e3SzQ0INx7PT E5Lw6ZOHB6ZwWcblZ3y49KAZcu/WsfQ8/iJCVD+OXuQ5peyXdtj3uVdIiANkZzPGUpXR lXfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=LEAS/HhG/25l7wJdkmzeFAACfnG9p71axOsaesLOHos=; b=cY5iR/7f/TQ2Rz+H9j8tlKP8z16u4S3w/6+5kcIRRYuHjWQChRNlU/DoDXD18E4g++ 6Cm9Nc/uU0TriC/Iiw/avOntoBqFoYdgHXFRUc7TNIyqo7AWIK1k1djtGXEF7CRC5qJk ORm52uD7ph5J54ri2iEcuGRs8wskpyAiTZju3PNqyTSnbrMLyzH2cQ+xP4PqAMNgGWx1 wKHK6S5+rX66pRWn/KVPFyS/n5/fpXWNVoYW52WbCeUcTmURFVMU9gpqMJjYhkaeU4Z6 t+IFgTjxHEyGRr5EbjIAWGUQZMFgOLbuEeSviAKCFW80EdCAGfSCbSBhCZLVKCFae+mb dyAQ== X-Gm-Message-State: AOAM531MIYtVIGXpC/FG/UzPhGkfcrON1IDBJPdb08gBQ+krY4fD6ziD 5dbGlXg9sSQ20Z1Ws5e9OmiqRD0QNGDQjTXEbN8= X-Google-Smtp-Source: ABdhPJyRfiCPMSEXFiEUe3yv2gkoV+lh3x0C+C8io7QOS/TS7JmaAWVgBXyE/xJdODPRsxsADgd/7XUJAr5MoAWwH7E= X-Received: by 2002:a17:906:3383:: with SMTP id v3mr730781eja.213.1632757033181; Mon, 27 Sep 2021 08:37:13 -0700 (PDT) MIME-Version: 1.0 References: <877df4hl2g.fsf@waegenei.re> In-Reply-To: <877df4hl2g.fsf@waegenei.re> From: Zacchaeus Scheffer Date: Mon, 27 Sep 2021 11:37:02 -0400 Message-ID: Content-Type: multipart/alternative; boundary="000000000000f7a62d05ccfbde60" X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: John Kehayias , 50788@debbugs.gnu.org Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1632757130; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=LEAS/HhG/25l7wJdkmzeFAACfnG9p71axOsaesLOHos=; b=tmGyvi8rGWTRM7betS+im3N9bFYX8X1VqcidbFO8kxfKUs0keDzG1eQIOh6vVP033m1k/N tVRZStspRDn5kocO7IKG5orr/UF7Fu/h8ycOKV/btMAHmJEpE7gcmWMeFCxYFqifL55HIj KsBTcfKepnQ1Y3YJVBMDTbOapV0XuPkKHmgD0OH9mzgmyfMHjiZ4Y3flXD41NOzYTWjCZp 19JCVE9U6N3SifQjFFL0QMXXxrf/t/SdCFGNjokQPg48xg4OnhfHp6kPPch8HtXgov3mzW wFwCV72YXHwaTaSBWGCTnPizE+vy9yo28Bp9jehyFwkEpwEWjGq4+1EMj3l55g== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1632757130; a=rsa-sha256; cv=none; b=ZKIiok27dxSxdBZo4/6QkdX4w1GxtBaAVbFXuIYTXaf7NV3AkqwfT1cpOSW1bpoeIvbtd9 2dxfh33LoKoJEBa1RTGv2EzfJcrMetgLUsX60Rkf3CjnuafgpAHCFtJI0jVKK98gbm18Tu jgeZZ3ZssTdaqU6r4MlUKtcbw7qz4V5zIIAr7XfVtOwYw36JhfGsK3Z5O6Xf7CWnEphsze slf3PMBkwDbqYlmMN8RAITwXmFYUvOXWHoJwgH3mrgXJCVThFrMm8ffdz4n23O0mKId/Cn SygQfdf58f9LH5gOSXg0CDojv+6BNCjpPcB//9sG6Lkb5Dpdw2VuRWJydY6fNg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=XvzrBJ9x; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Spam-Score: 0.21 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=XvzrBJ9x; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Queue-Id: 70E71170C3 X-Spam-Score: 0.21 X-Migadu-Scanner: scn0.migadu.com X-TUID: 3PlfCUN1x0S5 --000000000000f7a62d05ccfbde60 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Brice, Yes, setting "(needed-for-boot? #t)" did it for me. I agree that adding a dependencies field for swap devices is the "correct" solution. Thanks, -Zacchae On Sat, Sep 25, 2021 at 8:54 AM Brice Waegeneire wrote: > > Hello John and Zacchaeus, > > A month ago I open a thread in guix-devel titled =E2=80=9CUsing a swapfil= e on > btrfs for > hibernation=E2=80=9D=C2=B9 describing in depth my setup about your specif= ic issue but > it had > no response so far. It should be detailled enought for you to reproduce = a > similar setup and if not I would like your feedbakc on it. > > John Kehayias writes: > > > This has been discussed a few times on #guix, with some having success, > but mostly it seems not. The issue is having a swapfile (maybe also for > partition?) on Btrfs and swap not being activated on boot. In my case, I > can manually start with `sudo herd start swap-/swap/swapfile` and it will > work fine. There might be an issue with when different filesystems are > loaded with Btrfs subvolumes? I have my swap as a file on a subvolume. > > > > > >>From syslog, just before and after the only "swap" related message: > > [...] > > > Checking the status of the service shows: > > [...] > > > This is the file-systems and swap part of my system configuration: > > Following are the same output as yours but from a working setup. > > --8<---------------cut here---------------start------------->8--- > # dmesg > [...] > [ 6.393304] shepherd[1]: Service udev has been started. > [ 6.431318] Adding 32488200k swap on /swap/swapfile. Priority:-2 > extents:2 across:32706248k FS > [ 6.433275] shepherd[1]: Service swap-/swap/swapfile has been started. > [ 6.434347] shepherd[1]: Service user-file-systems has been started. > [ 6.469352] shepherd[1]: Service file-system-/boot/efi has been starte= d. > [ 6.535679] shepherd[1]: Service file-system-/home has been started. > [...] > --8<---------------cut here---------------end--------------->8--- > > --8<---------------cut here---------------start------------->8--- > # herd status swap-/swap/swapfile > Status of swap-/swap/swapfile: > It is started. > Running value is #t. > It is enabled. > Provides (swap-/swap/swapfile). > Requires (udev). > Conflicts with (). > Will not be respawned. > --8<---------------cut here---------------end--------------->8--- > > Here are the file-systems and swap-devices fields of my operating-system: > --8<---------------cut here---------------start------------->8--- > (file-systems > (append (list (file-system > (mount-point "/boot/efi") > (device (uuid "588A-2266" 'fat32)) > (type "vfat")) > (file-system > (mount-point "/swap") > (device (uuid "2ab8e658-5878-4acd-ba33-8a46707a3828" > 'btrfs)) > (type "btrfs") > (needed-for-boot? #t) > (options "compress=3Dzstd,subvol=3Dswap"))) > (hash-map->list > (lambda (mount-point subvolume) > (file-system > (mount-point mount-point) > (device (uuid "2ab8e658-5878-4acd-ba33-8a46707a3828" > 'btrfs)) > (type "btrfs") > (options (string-append "compress=3Dzstd" ",subvol=3D" > subvolume)))) > (alist->hash-table '(("/" . "guix-system") > ("/home" . "home") > ;; ("/swap" . "swap") > ("/mnt/btrfs-root" . "/")))) > %base-file-systems)) > > (swap-devices (list "/swap/swapfile")) > --8<---------------cut here---------------end--------------->8--- > > > Hope this is helpful in tracking down what is happening, I know I'm not > alone in this issue. > > I think you are just missing =E2=80=9C(needed-for-boot? #t)=E2=80=9D on y= our swap > subvolume, > even tho you shouldn't need to have it mounted from the initramfs (except > if you > want to hibernate on your swapfile). On the thread previsouly cited=C2= =B9, I > suggest > two new records =E2=80=9Cswap-file=E2=80=9D and =E2=80=9Cswap-device=E2= =80=9D where it would make sense to > add > an additional =E2=80=9Cdependecies=E2=80=9D field, similar to the one in = =E2=80=9Dfile-system=E2=80=9D > record, > which would list the =E2=80=9Cfile-system=E2=80=9D to be mounted before a= ctivating that > swap > file (or device). > > Hope it helps. > > =C2=B9 https://yhetil.org/guix/87zgt9nrmg.fsf@waegenei.re/ > > Cheers, > - Brice > --000000000000f7a62d05ccfbde60 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Brice,

Yes, setting "(needed-for-boot? #t)&= quot; did it for me.=C2=A0 I agree that adding a dependencies field for swa= p devices is=C2=A0the "correct" solution.

Than= ks,
-Zacchae

On Sat, Sep 25, 2021 at 8:54 AM Brice Waegene= ire <brice@waegenei.re> wrot= e:

Hello John and Zacchaeus,

A month ago I open a thread in guix-devel titled =E2=80=9CUsing a swapfile = on btrfs for
hibernation=E2=80=9D=C2=B9 describing in depth my setup about your specific= issue but it had
no response so far.=C2=A0 It should be detailled enought for you to reprodu= ce a
similar setup and if not I would like your feedbakc on it.

John Kehayias <john.kehayias@protonmail.com> writes:

> This has been discussed a few times on #guix, with some having success= , but mostly it seems not. The issue is having a swapfile (maybe also for p= artition?) on Btrfs and swap not being activated on boot. In my case, I can= manually start with `sudo herd start swap-/swap/swapfile` and it will work= fine. There might be an issue with when different filesystems are loaded w= ith Btrfs subvolumes? I have my swap as a file on a subvolume.
>


>>From syslog, just before and after the only "swap" relate= d message:

[...]

> Checking the status of the service shows:

[...]

> This is the file-systems and swap part of my system configuration:

Following are the same output as yours but from a working setup.

--8<---------------cut here---------------start------------->8---
# dmesg
[...]
[=C2=A0 =C2=A0 6.393304] shepherd[1]: Service udev has been started.
[=C2=A0 =C2=A0 6.431318] Adding 32488200k swap on /swap/swapfile.=C2=A0 Pri= ority:-2 extents:2 across:32706248k FS
[=C2=A0 =C2=A0 6.433275] shepherd[1]: Service swap-/swap/swapfile has been = started.
[=C2=A0 =C2=A0 6.434347] shepherd[1]: Service user-file-systems has been st= arted.
[=C2=A0 =C2=A0 6.469352] shepherd[1]: Service file-system-/boot/efi has bee= n started.
[=C2=A0 =C2=A0 6.535679] shepherd[1]: Service file-system-/home has been st= arted.
[...]
--8<---------------cut here---------------end--------------->8---

--8<---------------cut here---------------start------------->8---
# herd status swap-/swap/swapfile
Status of swap-/swap/swapfile:
=C2=A0 It is started.
=C2=A0 Running value is #t.
=C2=A0 It is enabled.
=C2=A0 Provides (swap-/swap/swapfile).
=C2=A0 Requires (udev).
=C2=A0 Conflicts with ().
=C2=A0 Will not be respawned.
--8<---------------cut here---------------end--------------->8---

Here are the file-systems and swap-devices fields of my operating-system: --8<---------------cut here---------------start------------->8---
(file-systems
=C2=A0 (append (list (file-system
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(mount-point = "/boot/efi")
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(device (uuid= "588A-2266" 'fat32))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(type "v= fat"))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (file-system
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(mount-point = "/swap")
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(device (uuid= "2ab8e658-5878-4acd-ba33-8a46707a3828" 'btrfs))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(type "b= trfs")
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(needed-for-b= oot? #t)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(options &quo= t;compress=3Dzstd,subvol=3Dswap")))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (hash-map->list
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(lambda (mount-point subvolume) =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(file-system
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(mount-point mount-p= oint)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(device (uuid "= 2ab8e658-5878-4acd-ba33-8a46707a3828" 'btrfs))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(type "btrfs&qu= ot;)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(options (string-app= end "compress=3Dzstd" ",subvol=3D" subvolume))))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(alist->hash-table '(("= ;/"=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0. &qu= ot;guix-system")
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ("/home"=C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0. "home")
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ;; ("/swap"=C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0. "swap")
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ("/mnt/btrfs-root"=C2=A0 = =C2=A0. "/"))))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 %base-file-systems))

(swap-devices (list "/swap/swapfile"))
--8<---------------cut here---------------end--------------->8---

> Hope this is helpful in tracking down what is happening, I know I'= m not alone in this issue.

I think you are just missing =E2=80=9C(needed-for-boot? #t)=E2=80=9D on you= r swap subvolume,
even tho you shouldn't need to have it mounted from the initramfs (exce= pt if you
want to hibernate on your swapfile).=C2=A0 On the thread previsouly cited= =C2=B9, I suggest
two new records =E2=80=9Cswap-file=E2=80=9D and =E2=80=9Cswap-device=E2=80= =9D where it would make sense to add
an additional =E2=80=9Cdependecies=E2=80=9D field, similar to the one in = =E2=80=9Dfile-system=E2=80=9D record,
which would list the =E2=80=9Cfile-system=E2=80=9D to be mounted before act= ivating that swap
file (or device).

Hope it helps.

=C2=B9 https://yhetil.org/guix/87zgt9nrmg.fsf@wa= egenei.re/

Cheers,
- Brice
--000000000000f7a62d05ccfbde60--