linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Duncan <1i5t5.duncan@cox.net>
To: linux-btrfs@vger.kernel.org
Subject: Re: What is the current status of defragmentation?
Date: Thu, 18 Jul 2013 07:53:00 +0000 (UTC)	[thread overview]
Message-ID: <pan$b4fcd$f147b0cc$851fe847$1ba9dd4f@cox.net> (raw)
In-Reply-To: 62476934.S7K7xSYr36@bheem

Shridhar Daithankar posted on Thu, 18 Jul 2013 08:29:22 +0530 as
excerpted:

> [A]fter you fully defrag the system(every btrfs
> mount/partition/filesystem), rebooting immediately with
> compress/autodefrag should do it automatically, since then.

Indeed.

It's worth noting that the automated install system used by many distros 
leaves system files (obviously, no user files at that point) rather 
fragmented.  Since the install process may leave no opportunity to mount 
with autodefrag during the install, it's worth either pre-creating/pre-
mounting the system partitions and skipping the part of the install 
process that would create and mount them, or installing to a temporary 
location and copying the whole install to a final location once you have 
the final destinations created/mounted with autodefrag and optionally 
compress, etc.  That'll save quite some time of the initial defrag 
slowing down the system, as well as allow you to defrag otherwise in-use 
files that aren't "online defragged" otherwise.

> Are you mounting with noatime? storing access time could lead to massive
> direcory level fragmentation which is hard to measure.

The kernel's relatime default helps, but unless you're running something 
like mutt that really depends on atime, it's worth using noatime as a 
rule.  (The only volumes I don't use noatime on are virtual filesystems 
such as tmpfs and sysfs, where it's simply a memory access in any case 
and I've seen no qualified opinion or benchmarks arguing either way.)

> filefrag can help you but its per file and does not exactly give the
> level of fragmentation.

Someone did mention that btrfs compressed files larger than some size 
(the btrfs leaf size?) will always look fragmented to filefrag.  I do not 
personally understand enough about it to verify, however.

-- 
Duncan - List replies preferred.   No HTML msgs.
"Every nonfree program has a lord, a master --
and if you use the program, he is your master."  Richard Stallman


      reply	other threads:[~2013-07-18  7:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-17 22:18 What is the current status of defragmentation? Adam Ryczkowski
2013-07-18  0:17 ` George Mitchell
     [not found]   ` <51E79542.9030001@statystyka.net>
2013-07-18 13:37     ` George Mitchell
2013-07-18  0:22 ` Duncan
2013-07-18  2:59 ` Shridhar Daithankar
2013-07-18  7:53   ` Duncan [this message]

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='pan$b4fcd$f147b0cc$851fe847$1ba9dd4f@cox.net' \
    --to=1i5t5.duncan@cox.net \
    --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).