linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: A L <mail@lechevalier.se>
To: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>,
	waxhead <waxhead@dirtcellar.net>
Cc: Btrfs BTRFS <linux-btrfs@vger.kernel.org>
Subject: Re: Switching from spacecache v1 to v2
Date: Mon, 2 Nov 2020 06:48:11 +0100	[thread overview]
Message-ID: <04d57bc4-c406-0d54-8299-662883fd48da@lechevalier.se> (raw)
In-Reply-To: <20201101174902.GU5890@hungrycats.org>


>> And
>> How do I make the switch properly?
> Unmount the filesystem, mount it once with -o clear_cache,space_cache=v2.
> It will take some time to create the tree.  After that, no mount option
> is needed.
>
> With current kernels it is not possible to upgrade while the filesystem is
> online, i.e. to upgrade "/" you have to set rootflags in the bootloader
> or boot from external media.  That and the long mount time to do the
> conversion (which offends systemd's default mount timeout parameters)
> are the two major gotchas.
>
> There are some patches for future kernels that will take care of details
> like deleting the v1 space cache inodes and other inert parts of the
> space_cache=v1 infrastructure.  I would not bother with these
> now, and instead let future kernels clean up automatically.

There is also this option according to the man page of btrfs-check:
https://btrfs.wiki.kernel.org/index.php/Manpage/btrfs-check

--clear-space-cache v1|v2
     completely wipe all free space cache of given type
     For free space cache v1, the clear_cache kernel mount option only 
rebuilds the free space cache for block groups that are modified while 
the filesystem is mounted with that option. Thus, using this option with 
v1 makes it possible to actually clear the entire free space cache.
     For free space cache v2, the clear_cache kernel mount option 
destroys the entire free space cache. This option, with v2 provides an 
alternative method of clearing the free space cache that doesn’t require 
mounting the filesystem.

Is there any practical difference to clearing the space cache using 
mount options? For example, would a lot of old space_cache=v1 data 
remain on-disk after mounting -o clear_cache,space_cache=v2 ? Would that 
affect performance in any way?

Thanks.

  reply	other threads:[~2020-11-02  5:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-31  0:27 Switching from spacecache v1 to v2 waxhead
2020-11-01 17:49 ` Zygo Blaxell
2020-11-02  5:48   ` A L [this message]
2020-11-02 14:40     ` Zygo Blaxell
2020-11-02 17:03   ` waxhead

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=04d57bc4-c406-0d54-8299-662883fd48da@lechevalier.se \
    --to=mail@lechevalier.se \
    --cc=ce3g8jdj@umail.furryterror.org \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=waxhead@dirtcellar.net \
    /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;
as well as URLs for NNTP newsgroup(s).