All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shridhar Daithankar <ghodechhap@ghodechhap.net>
To: Adam Ryczkowski <adam.ryczkowski@statystyka.net>,
	linux-btrfs@vger.kernel.org
Subject: Re: What is the current status of defragmentation?
Date: Thu, 18 Jul 2013 08:29:22 +0530	[thread overview]
Message-ID: <62476934.S7K7xSYr36@bheem> (raw)
In-Reply-To: <51E7182F.9020009@statystyka.net>

On Thursday, July 18, 2013 12:18:23 AM you wrote:
> * Is the defragmentation of the whole filesystem supported at all? I
> can't find a single reference that it is, and a syntax of btrfs-progs
> suggest that it isn't. If supported, under what conditions? Like what %
> of free space should be available?

It works for me, I have done it few times on 3.9.9/arch. But I have kept 
plenty of free space handy to avoid any corner cases.

> * How to check the level of defragmentation, and what are the reasonable
> threshold values, that should indicate the desktop filesystem needs
> defragmenting? I know, that everyone's millage my vary; I just want to
> know some values as a point-of-reference.

Thats a hard question to answer but after you fully defrag the system(every 
btrfs mount/partition/filesystem), rebooting immediately with 
compress/autodefrag should do it automatically, since then.

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

filefrag can help you but its per file and does not exactly give the level of 
fragmentation.
> 
> * What is the recommended command, that would efficiently defragment the
> whole file system, preferably with some sort of progress indication?
> Does this command
> 
> find / -type f -o -type d -print0 | xargs --null --no-run-if-empty btrfs
> filesystem defragment -cv
> 
> look like a reasonable idiom for defragmenting the whole filesystem?

again, I use this. no progress indicator but it works

----------
for dir in / /home ;
do

find $dir -mount -type d -exec btrfs fi defrag '{}' \; ;
find $dir -mount -type f -exec btrfs fi defrag '{}' \; ;

done
----------

HTH


-- 
Regards
 Shridhar

  parent reply	other threads:[~2013-07-18  2:59 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 [this message]
2013-07-18  7:53   ` Duncan

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=62476934.S7K7xSYr36@bheem \
    --to=ghodechhap@ghodechhap.net \
    --cc=adam.ryczkowski@statystyka.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.