From: Andrei Borzenkov <arvidjaar@gmail.com>
To: Christoph Anton Mitterer <calestyo@scientia.org>,
linux-btrfs@vger.kernel.org
Subject: Re: btrfs and hibernation to swap file on it?
Date: Wed, 28 Sep 2022 22:12:48 +0300 [thread overview]
Message-ID: <ed497bfa-1f82-6761-788e-a20ef3b91cab@gmail.com> (raw)
In-Reply-To: <31660c315eeba4c461b6006b6d798355696d2155.camel@scientia.org>
On 27.09.2022 18:45, Christoph Anton Mitterer wrote:
> Hey.
>
> Maybe someone could help me with that question:
>
> I'd like to set up hibernation, using a swapfile on btrfs (which itself
> is on dm-crypt).
>
> Now I'm aware of the section on swaptfiles in btrfs(5) and their
> restrictions... and I think these should be fine for me.
>
>
> What I don't quite get is:
>
> a) Hibernate seems to want an offset parameter for the swapfile. How is
> that used respectively why is it needed.
>
> Does that mean that hibernation directly writes/reads to/from the block
> device?
Correct.
> And wouldn't that be kind of fragile (if something internally moves in
> the fs... or if it's split in several extents and not one big
> contiguous space)?
>
There are quite some restrictions for using swapfile on btrfs, in
particular, it must be preallocated and btrfs will refuse relocation of
extents in this file.
kernel supports swapfile with multiple extents.
> Guess I would be kinda scared to get some corruptions if something
> writes directly to the btrfs' block device - other than btrfs.
>
> Are there any suggestions with respect to btrfs? Like not using a
> swapfile for hibernation, or is it considered safe?
>
>
> b) Internet resources say that for btrfs one cannot use filefrag to get
> the offset.
> I found Omar's tool, but wondered whether the same had been directly
> integrated into btrfs-progs in the meantime?
>
>
>
> Thanks,
> Chris.
next prev parent reply other threads:[~2022-09-28 19:13 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-27 15:45 btrfs and hibernation to swap file on it? Christoph Anton Mitterer
2022-09-28 19:12 ` Andrei Borzenkov [this message]
2022-10-23 21:19 ` Christoph Anton Mitterer
2022-09-30 12:12 ` Forza
2022-10-23 21:25 ` Christoph Anton Mitterer
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=ed497bfa-1f82-6761-788e-a20ef3b91cab@gmail.com \
--to=arvidjaar@gmail.com \
--cc=calestyo@scientia.org \
--cc=linux-btrfs@vger.kernel.org \
/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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox