Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: Eric Wong <e@80x24.org>
To: linux-btrfs@vger.kernel.org
Subject: defragmenting non-files only
Date: Sun, 27 Jul 2025 20:33:27 +0000	[thread overview]
Message-ID: <20250727203327.M348733@dcvr> (raw)

I'm wondering how much fragmentation affects users with large
active Maildirs where files are frequently created and removed.

I'm avoiding a blanket `btrfs fi defrag -r` to reduce storage
wear for files which won't live long.

So some questions:

1. how to monitor fragmentation of subvolume/extent tree or
   anything else which filefrag(8) doesn't seem to report
   fragmentation for?

2. does `btrfs fi defrag $DIR' work only for that directory?
   In other words, can I `btrfs fi defrag $TOPLEVEL_DIR` and
   expect subdirectories to be defragmented?

   Or should I do:

	find $TOPLEVEL_DIR -type d -print0 | xargs -0 btrfs fi defrag
   ?

Thanks.

                 reply	other threads:[~2025-07-27 20:40 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20250727203327.M348733@dcvr \
    --to=e@80x24.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