On 8 July 2013 22:12, David Sterba <dsterba@xxxxxxx> wrote: > On Tue, Jul 02, 2013 at 02:28:25PM +0100, Paul Richards wrote: >> When I run "btrfs filesystem balance", does this implicitly >> defragment the filesystem? (Assuming there is plenty free space) > > In some sense it defragments the filesystem. The blockgroups are moved > around based on the balance filter. Here a blockgroup consists of > various and unrelated file extents. Extents representing a single file > are not made contiguous, this is done by 'btrfs file defrag'. > > I think that the final layout of the 1G-chunks is not necessarily > contiguous, ie. it depends on the chunk-allocator, the time of the > allocation request and there's nothing like "preallocate 30G for whole > balance and put all data together because the space is available". > Okay, I think I understand. It sounds like balance will fix external fragmentation (within the block groups, up to the 1G-chunk granularity), and will not fix any internal fragmentation. Thanks. :) -- Paul Richards @pauldoo -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html
