From: George Mitchell <george@chinilu.com>
To: linux-btrfs@vger.kernel.org
Subject: Re: What is the current status of defragmentation?
Date: Thu, 18 Jul 2013 06:37:42 -0700 [thread overview]
Message-ID: <51E7EFA6.10503@chinilu.com> (raw)
In-Reply-To: <51E79542.9030001@statystyka.net>
Indeed! That is a VERY good question and one I have not seen a good
answer to thus far. A traditional defragger in the Windows realm, which
defrags on a global basis rather than directory by directory, file by
file, also "restacks" the file and directory structure in a way that
minimizes free space and the result is also close to a maximum amount of
contiguous free space somewhere within the filesystem after the defrag
process finishes. As you correctly point out, no one has indicated a
method as to how that can be accomplished with btrfs at this point. I
am not even sure that rebuilding the partition from scratch would do the
job. My solution so far is just to always make sure to have a
ridiculous amount of free space available, but that cannot go on forever
(and is very inefficient). So it would be nice to know what the
solution to this conundrum would be. Thanks for pointing this out.
On 07/18/2013 12:12 AM, Adam Ryczkowski wrote:
> On 07/18/2013 02:17 AM, George Mitchell wrote:
>> find /home -type d -mtime -3 -o -type f -mtime -3 | egrep -v
>> "Cache|cache" | while read file; do /usr/sbin/btrfs filesystem defrag
>> -f -v "${file}"; done
> Thank you for your answer.
>
> This still defragments file-after-file. But what about a little
> consolidation of free space? As I understand, if there is no consecutive
> free space for a file's extents, it is impossible to defragment it, no
> matter how many times I run the above command, am I right?
>
> Adam Ryczkowski
>
> <http://www.google.com/>
>
>
>
next prev parent reply other threads:[~2013-07-18 13:37 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 [this message]
2013-07-18 0:22 ` Duncan
2013-07-18 2:59 ` Shridhar Daithankar
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=51E7EFA6.10503@chinilu.com \
--to=george@chinilu.com \
--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).