From: David Sterba <dsterba@suse.cz>
To: Andrei Borzenkov <arvidjaar@gmail.com>
Cc: Chris Murphy <lists@colorremedies.com>,
Ken D'Ambrosio <ken@jots.org>,
Btrfs BTRFS <linux-btrfs@vger.kernel.org>
Subject: Re: Btrfs default on Fedora?
Date: Mon, 13 Jul 2020 11:13:58 +0200 [thread overview]
Message-ID: <20200713091358.GC3703@twin.jikos.cz> (raw)
In-Reply-To: <d81cea36-bb02-88a4-e65e-3070f0dc76d9@gmail.com>
On Sun, Jul 12, 2020 at 08:28:32AM +0300, Andrei Borzenkov wrote:
> 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:
When the swapfile is not used for suspend/resume, the offsets don't
matter. The reads and writes build on generic DIO infrastructure, in the
same way swap-over-NFS works that also does not have any physical
offsets in general.
> 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.
Yeah, that's where the swapfile is not accessed through the filesystem,
so the block offsets need to be calculated externally.
next prev parent reply other threads:[~2020-07-13 9:14 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
2020-07-13 9:13 ` David Sterba [this message]
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=20200713091358.GC3703@twin.jikos.cz \
--to=dsterba@suse.cz \
--cc=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