all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Brice Waegeneire <brice@waegenei.re>
To: John Kehayias <john.kehayias@protonmail.com>
Cc: zaccysc@gmail.com, 50788@debbugs.gnu.org
Subject: bug#50788: Swapfile on Btrfs does not start at boot
Date: Sat, 25 Sep 2021 14:54:47 +0200	[thread overview]
Message-ID: <877df4hl2g.fsf@waegenei.re> (raw)
In-Reply-To: <TbQsNMzraZIGit6atyA0OzZlPwfsAZD8xpzM2LjZMnWEvV_d7Zs5OPpmUPiTl19KiOQvmw6Y6-eg8QHdOsxLOf6siP-wVjZAB-h2KzyBWiQ=@protonmail.com> (John Kehayias's message of "Fri, 24 Sep 2021 21:14:58 +0000")


Hello John and Zacchaeus,

A month ago I open a thread in guix-devel titled “Using a swapfile on btrfs for
hibernation”¹ describing in depth my setup about your specific 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 <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 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 started.
[    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=zstd,subvol=swap")))
          (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=zstd" ",subvol=" 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 “(needed-for-boot? #t)” on your 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¹, I suggest
two new records “swap-file” and “swap-device” where it would make sense to add
an additional “dependecies” field, similar to the one in ”file-system” record,
which would list the “file-system” to be mounted before activating that swap
file (or device).

Hope it helps.

¹ https://yhetil.org/guix/87zgt9nrmg.fsf@waegenei.re/

Cheers,
- Brice




  parent reply	other threads:[~2021-09-25 12:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-24 21:14 bug#50788: Swapfile on Btrfs does not start at boot John Kehayias via Bug reports for GNU Guix
2021-09-24 23:13 ` Zacchaeus Scheffer
2021-09-25 12:54 ` Brice Waegeneire [this message]
2021-09-27 15:37   ` Zacchaeus Scheffer
2021-09-27 18:25     ` John Kehayias via Bug reports for GNU Guix
2022-02-06 20:20 ` Josselin Poiret via Bug reports for GNU Guix

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=877df4hl2g.fsf@waegenei.re \
    --to=brice@waegenei.re \
    --cc=50788@debbugs.gnu.org \
    --cc=john.kehayias@protonmail.com \
    --cc=zaccysc@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.