linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Christian Völker" <cvoelker@knebb.de>
To: "linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>
Subject: Defragmentation vw. Deduplication
Date: Tue, 2 Mar 2021 22:31:08 +0100	[thread overview]
Message-ID: <11d7701c-4fd8-9bf1-c10e-755e55dd5e57@knebb.de> (raw)

Hi all,

might be a simple question but I did not find a trustable source for this.

BTRFS uses COW which might lead to fragmentation.
So using "btrfs fi defrag -r /mnt" will bring most file extend in a row 
and copy previously deduplicated extends.
Obviously this uses more disk space. This is not what I want, but I need 
to run "defrag" because I initially skipped the "compress=zstd" option 
when mounting. So many files are stored without compression. Therefor I 
neede to do the "defrag".

I am now unsure about the deduplication itself.  How does it work?
I create a file in a directory (ie on Monday). Some days later I create 
a file which has some extents with equal data. Does btrfs recon the 
equal extents and does it doe deduplication then? Or does it only do 
deduplication when ie "cp --reflink" is used?

However as I needed the compression and not the defragmentation is there 
any way to add compression and recreate deduplication later?

Sorry if this is a dumb question.

/KNEBB



             reply	other threads:[~2021-03-03  2:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-02 21:31 Christian Völker [this message]
2021-03-04  4:54 ` Defragmentation vw. Deduplication Zygo Blaxell

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=11d7701c-4fd8-9bf1-c10e-755e55dd5e57@knebb.de \
    --to=cvoelker@knebb.de \
    --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;
as well as URLs for NNTP newsgroup(s).