From: Andrei Borzenkov <arvidjaar@gmail.com>
To: Chris Murphy <lists@colorremedies.com>, Ken D'Ambrosio <ken@jots.org>
Cc: Btrfs BTRFS <linux-btrfs@vger.kernel.org>
Subject: Re: Btrfs default on Fedora?
Date: Sun, 12 Jul 2020 08:28:32 +0300 [thread overview]
Message-ID: <d81cea36-bb02-88a4-e65e-3070f0dc76d9@gmail.com> (raw)
In-Reply-To: <CAJCQCtSbBCJjKcwuNB9b2ZZQWjkwxvBQpC0C7UWVsAjBAN6BgA@mail.gmail.com>
12.07.2020 00:18, Chris Murphy пишет:
> On Sat, Jul 11, 2020 at 12:44 PM Ken D'Ambrosio <ken@jots.org> wrote:
>
>> * Swap files. At least last time I checked, it was a PITA to take a
>> snapshot of a volume that had a swapfile on it -- I wound up writing a
>> wrapper that goes, does a swapoff, removes the file, creates the
>> snapshot, and then re-creates the file. Is this still "a thing"? Or
>> is there a way to work around that that isn't kludgey?
>
> Put the swapfile in its own subvolume and don't snapshot it. One way
> is to create a (nested) subvolume named "swap" inside of the "root"
> subvolume created at installation time; use chattr +C on it; now
> create the swapfile per 'man 5 btrfs'.
>
> Since btrfs snapshots aren't recursive, making a snapshot of 'root'
> will not cause a snapshot to be taken of 'swap' or its swapfiles.
>
swap file requires calculation of absolute disk offset (that is what
kernel works with) and this is not supported on btrfs with by systemd:
https://github.com/systemd/systemd/blob/d67b1d18fcda2c8c5aacfc50f9591c8dc7a4a8a1/src/shared/sleep-config.c#L240
I believe with current systemd if you manually compute and provide
resume=btrfs-partition and resume_offset=absolute-offset-of-swapfile it
should take it, but using resume=file-on-btrfs will fail.
next prev parent reply other threads:[~2020-07-12 5:51 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-11 18:38 Btrfs default on Fedora? Ken D'Ambrosio
2020-07-11 21:18 ` Chris Murphy
2020-07-12 5:28 ` Andrei Borzenkov [this message]
2020-07-13 9:13 ` David Sterba
2020-07-13 9:32 ` David Sterba
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=d81cea36-bb02-88a4-e65e-3070f0dc76d9@gmail.com \
--to=arvidjaar@gmail.com \
--cc=ken@jots.org \
--cc=linux-btrfs@vger.kernel.org \
--cc=lists@colorremedies.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox