all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#50788: Swapfile on Btrfs does not start at boot
@ 2021-09-24 21:14 John Kehayias via Bug reports for GNU Guix
  2021-09-24 23:13 ` Zacchaeus Scheffer
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: John Kehayias via Bug reports for GNU Guix @ 2021-09-24 21:14 UTC (permalink / raw)
  To: 50788

Hi all,

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:

Sep 23 13:09:31 localhost vmunix: [    9.424364] shepherd[1]: Service udev has been started.
Sep 23 13:09:31 localhost vmunix: [    9.424466] Unable to find swap-space signature
Sep 23 13:09:31 localhost vmunix: [    9.424912] shepherd[1]: Service user-file-systems has been started.
Sep 23 13:09:31 localhost vmunix: [    9.443245] shepherd[1]: Service file-system-/swap has been started.
Sep 23 13:09:31 localhost vmunix: [    9.454002] shepherd[1]: Service file-system-/var/log has been started.
Sep 23 13:09:31 localhost vmunix: [    9.464911] shepherd[1]: Service file-system-/home has been started.

Checking the status of the service shows:

  It is stopped.
  It is enabled.
  Provides (swap-/swap/swapfile).
  Requires (udev).
  Conflicts with ().
  Will not be respawned.

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

  (file-systems (append
                 (list (file-system
                         (device (file-system-label "system"))
                         (mount-point "/")
                         (type "btrfs")
                         (flags '(no-atime))
                         (options "subvol=root,compress=lzo,ssd"))
                       (file-system
                         (device (file-system-label "system"))
                         (mount-point "/swap")
                         (type "btrfs")
                         (flags '(no-atime))
                         (options "subvol=swap,ssd"))
                       (file-system
                         (device (file-system-label "system"))
                         (mount-point "/gnu/store")
                         (type "btrfs")
                         (flags '(no-atime))
                         (options "subvol=gnu-store,compress=lzo,ssd"))
                       (file-system
                         (device (file-system-label "system"))
                         (mount-point "/var/log")
                         (type "btrfs")
                         (flags '(no-atime))
                         (options "subvol=var-log,compress=lzo,ssd"))
                       (file-system
                         (device (file-system-label "system"))
                         (mount-point "/home")
                         (type "btrfs")
                         (flags '(no-atime))
                         (options "subvol=home,compress=lzo,ssd"))
                       (file-system
                         (device (uuid "5989-F926" 'fat))
                         (mount-point "/boot/efi")
                         (type "vfat")))
                 %base-file-systems))
  (swap-devices (list "/swap/swapfile"))

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

John




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

* bug#50788: Swapfile on Btrfs does not start at boot
  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
  2022-02-06 20:20 ` Josselin Poiret via Bug reports for GNU Guix
  2 siblings, 0 replies; 6+ messages in thread
From: Zacchaeus Scheffer @ 2021-09-24 23:13 UTC (permalink / raw)
  To: 50788

[-- Attachment #1: Type: text/plain, Size: 945 bytes --]

I have the same problem.  I can start the swapfile normally with herd start
swap-/swap/swapfile, but it fails to start at boot.

Here are the (possibly) relevant parts of my system configuration:
 (mapped-devices
  (list
   (mapped-device
    (source (uuid "59d615e4-8a35-469c-aa24-88f28f084847"))
    (target "ex")
    (type luks-device-mapping))))
 (file-systems
  (append
   (list
    (file-system
     (type "btrfs")
     (mount-point "/")
     (device (file-system-label "ex"))
     (options "subvol=guix")
     (dependencies mapped-devices))
    (file-system
     (type "btrfs")
     (mount-point "/swap")
     (device (file-system-label "ex"))
     (options "subvol=swap")
     (dependencies mapped-devices))
    (file-system
     (type "vfat")
     (mount-point "/boot/efi")
     (device (file-system-label "EFI"))))
   %base-file-systems))
 (swap-devices
  (list "/swap/swapfile"))

Let me know if I should include more info.

-Zacchae

[-- Attachment #2: Type: text/html, Size: 1332 bytes --]

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

* bug#50788: Swapfile on Btrfs does not start at boot
  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
  2022-02-06 20:20 ` Josselin Poiret via Bug reports for GNU Guix
  2 siblings, 1 reply; 6+ messages in thread
From: Brice Waegeneire @ 2021-09-25 12:54 UTC (permalink / raw)
  To: John Kehayias; +Cc: zaccysc, 50788


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




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

* bug#50788: Swapfile on Btrfs does not start at boot
  2021-09-25 12:54 ` Brice Waegeneire
@ 2021-09-27 15:37   ` Zacchaeus Scheffer
  2021-09-27 18:25     ` John Kehayias via Bug reports for GNU Guix
  0 siblings, 1 reply; 6+ messages in thread
From: Zacchaeus Scheffer @ 2021-09-27 15:37 UTC (permalink / raw)
  To: Brice Waegeneire; +Cc: John Kehayias, 50788

[-- 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 --]

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

* bug#50788: Swapfile on Btrfs does not start at boot
  2021-09-27 15:37   ` Zacchaeus Scheffer
@ 2021-09-27 18:25     ` John Kehayias via Bug reports for GNU Guix
  0 siblings, 0 replies; 6+ messages in thread
From: John Kehayias via Bug reports for GNU Guix @ 2021-09-27 18:25 UTC (permalink / raw)
  To: Zacchaeus Scheffer; +Cc: Brice Waegeneire, 50788

[-- Attachment #1: Type: text/plain, Size: 540 bytes --]

Hi Brice and Zacchaeus,

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Monday, September 27th, 2021 at 11:37 AM, Zacchaeus Scheffer wrote:

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

Worked for me too, thanks! I'm guessing this is only needed for btrfs not ext4 for example? In any event, I support any change that makes it more obvious, at the very least a note and example in the documentation for swap.

John

[-- Attachment #2: Type: text/html, Size: 864 bytes --]

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

* bug#50788: Swapfile on Btrfs does not start at boot
  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
@ 2022-02-06 20:20 ` Josselin Poiret via Bug reports for GNU Guix
  2 siblings, 0 replies; 6+ messages in thread
From: Josselin Poiret via Bug reports for GNU Guix @ 2022-02-06 20:20 UTC (permalink / raw)
  To: 50788-done

Hello,

swap-devices now include a dependencies system since
133a61ae263520378ac44482810d7adecfb017d9, see "(guix) Swap Space".

Closing.

-- 
Josselin Poiret




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

end of thread, other threads:[~2022-02-06 20:22 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

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.