From: Ivan Vilata i Balaguer <ivan@selidor.net>
To: Ivan Vilata i Balaguer <ivan@selidor.net>
Cc: Mekeor Melire <mekeor@posteo.de>,
guix-devel@gnu.org, Tobias Geerinckx-Rice <me@tobias.gr>
Subject: Re: Status of hibernation (suspend to disk) in Guix
Date: Wed, 14 Dec 2022 10:43:46 +0100 [thread overview]
Message-ID: <Y5ma0oW4hUf21wFV@sax> (raw)
In-Reply-To: <Y5eLCU6WR0J3YG55@sax>
[-- Attachment #1: Type: text/plain, Size: 2140 bytes --]
Ivan Vilata i Balaguer (2022-12-12 21:11:53 +0100) wrote:
> Mekeor Melire (2022-12-10 01:00:24 +0000) wrote:
>
> > > What about the "filefrag" executable from the "e2fsprogs" package.
> > > According to this article, it can be used in place of the deprecated
> > > uswsusp suite:
> > >
> > > https://www.linuxuprising.com/2021/08/how-to-enable-hibernation-on-ubuntu.html
>
> Good find! Besides the issue of `filefrag` being ExtFS-specific, another
> thing that worries me is [this check][1] that `swap-offset` does about the
> swap header being physically contiguous on disk, which would need to be made
> manually with `filefrag`.
>
> [1]: https://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspend-utils.git/tree/swap-offset.c#n114
I had a quick look to the [source code of mkswap][1] and it does take care of
checking whether the swap file has holes in it (look for the word "hole"). If
it has, it prints a warning (but it continues). For instance:
```
$ dd if=/dev/zero of=swap bs=512 count=1 seek=1000
1+0 records in
1+0 records out
512 bytes copied, 0.000234313 s, 2.2 MB/s
$ mkswap swap
mkswap: swap contains holes or other unsupported extents.
This swap file can be rejected by kernel on swap activation!
Use --verbose for more details.
Setting up swapspace version 1, size = 496 KiB (507904 bytes)
no label, UUID=3c5920cb-04ee-4713-8008-c2c1bebc2f6f
```
[1]: https://github.com/util-linux/util-linux/blob/master/disk-utils/mkswap.c
Since it's unlikely that the file will change its block arrangement on disk,
and enlarging it requires another invocation of `mkswap`, it's probably enough
to tell the user to check for such warnings on `mkswap` invocation (in section
"(guix)Keyboard Layout, Networking, and Partitioning"), and then instructing
them to use `filefrag` in "(guix)Swap Space" should be ok.
I can work on an additional patch for that, but I can't ensure that it'll be
ready before 1.4.0 (I'm not in the dev team, so I don't know what the planning
for the release is 😉).
Cheers!
--
Ivan Vilata i Balaguer -- https://elvil.net/
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2022-12-14 9:44 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-02 20:12 Status of hibernation (suspend to disk) in Guix Ivan Vilata i Balaguer
2022-12-02 20:32 ` Tobias Geerinckx-Rice
2022-12-05 16:23 ` Ivan Vilata i Balaguer
2022-12-09 23:10 ` Mekeor Melire
2022-12-10 1:00 ` Mekeor Melire
2022-12-12 20:11 ` Ivan Vilata i Balaguer
2022-12-14 9:43 ` Ivan Vilata i Balaguer [this message]
2022-12-21 12:27 ` Ivan Vilata i Balaguer
2023-01-07 11:36 ` Ivan Vilata i Balaguer
2022-12-09 20:52 ` Mekeor Melire
2022-12-09 21:16 ` Jack Hill
-- strict thread matches above, loose matches on Subject: below --
2022-12-15 6:55 Nathan Dehnel
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
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Y5ma0oW4hUf21wFV@sax \
--to=ivan@selidor.net \
--cc=guix-devel@gnu.org \
--cc=me@tobias.gr \
--cc=mekeor@posteo.de \
/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 public inbox
https://git.savannah.gnu.org/cgit/guix.git
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).