From: Zacchaeus Scheffer <zaccysc@gmail.com>
To: Brice Waegeneire <brice@waegenei.re>
Cc: John Kehayias <john.kehayias@protonmail.com>, 50788@debbugs.gnu.org
Subject: bug#50788: Swapfile on Btrfs does not start at boot
Date: Mon, 27 Sep 2021 11:37:02 -0400 [thread overview]
Message-ID: <CAJejy7mBxVpn6-cYgvHNboR5bURm_0T1NtPgai8H3sAYEuyJEg@mail.gmail.com> (raw)
In-Reply-To: <877df4hl2g.fsf@waegenei.re>
[-- Attachment #1: Type: text/plain, Size: 4633 bytes --]
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 <brice@waegenei.re> wrote:
>
> 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
>
[-- Attachment #2: Type: text/html, Size: 5820 bytes --]
next prev parent reply other threads:[~2021-09-27 15:38 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
2021-09-27 15:37 ` Zacchaeus Scheffer [this message]
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=CAJejy7mBxVpn6-cYgvHNboR5bURm_0T1NtPgai8H3sAYEuyJEg@mail.gmail.com \
--to=zaccysc@gmail.com \
--cc=50788@debbugs.gnu.org \
--cc=brice@waegenei.re \
--cc=john.kehayias@protonmail.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.