linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Divya Indi <divya.indi@oracle.com>
To: linux-btrfs@vger.kernel.org
Cc: ashish.samant@oracle.com, bo.li.liu@oracle.com
Subject: btrfs-progs: Add 2 new subcommands to inspect-internal
Date: Mon, 17 Oct 2016 17:35:12 -0700	[thread overview]
Message-ID: <1476750915-3105-1-git-send-email-divya.indi@oracle.com> (raw)

These patches aim to add 2 new subcommands that:
-> provide information about block groups
-> help to decide whether balance can reduce the no. of data block groups and if
 it can, provides the block group object id for "-dvrange"

[PATCH 1/3] btrfs-progs: Generic functions to retrieve chunks and their bg info
[PATCH 2/3] btrfs-progs: Add a command to show bg info
[PATCH 3/3] btrfs-progs: Add command to check if balance op is req

Now, you can run:
-------------------------------------------------------------------------------
$ btrfs inspect-internal balance_check /mnt/btrfs
               Start                 Len                Used
            12582912             8.00MiB           128.00KiB
           136708096           208.00MiB            74.00MiB

Total data bgs: 2
Total free space: 141.88MiB
For min used bg 12582912 used = 128.00KiB free = 7.88MiB
run 'btrfs balance start -dvrange=12582912..12582913 <mountpoint>'

$ btrfs balance start -dvrange=12582912..12582913 /mnt/btrfs
Done, had to relocate 1 out of 4 chunks

$ btrfs inspect-internal balance_check /mnt/btrfs
               Start                 Len                Used
           136708096           208.00MiB            74.12MiB
Data block groups in fs = 1, no need to do balance.

$ btrfs inspect-internal bg_analysis /mnt/btrfs

                Type               Start                 Len                Used
              SYSTEM            20971520             8.00MiB            16.00KiB
            METADATA            29360128           102.38MiB           192.00KiB
                DATA           136708096           208.00MiB            74.12MiB
-------------------------------------------------------------------------------

Thanks to the suggestion by Hans van Kranenburg, and the python-btrfs module,
an efficient alternative to retrieving block groups could be used:
Now, it first looks at the chunk tree, and for every chunk listed it looks up an
exact match in the extent tree.


             reply	other threads:[~2016-10-18  0:35 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-18  0:35 Divya Indi [this message]
2016-10-18  0:35 ` [PATCH 1/3] btrfs-progs: Generic functions to retrieve chunks and their bg info Divya Indi
2016-10-18  0:35   ` [PATCH 2/3] btrfs-progs: Add a command to show " Divya Indi
2016-10-18  0:35     ` [PATCH 3/3] btrfs-progs: Add command to check if balance op is req Divya Indi
2016-10-18  1:42       ` Qu Wenruo
2016-10-19 17:08         ` Divya Indi
2016-10-28 15:20           ` David Sterba
2016-10-28 16:29             ` Graham Cobb
2016-10-31 16:33               ` David Sterba
2016-11-02  0:39                 ` divya.indi
2016-10-30 14:10             ` Qu Wenruo
2016-10-18  1:39     ` [PATCH 2/3] btrfs-progs: Add a command to show bg info Qu Wenruo
2016-10-18  5:24       ` Roman Mamedov
2016-10-19 17:33         ` Divya Indi
2016-10-28 16:00     ` David Sterba
2016-11-02  0:40       ` divya.indi
2016-10-18  1:34   ` [PATCH 1/3] btrfs-progs: Generic functions to retrieve chunks and their " Qu Wenruo
2016-10-28 15:44   ` David Sterba
2016-11-02  0:39     ` divya.indi
2017-06-07 17:03     ` Goffredo Baroncelli
2017-06-09 21:57       ` divya.indi

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=1476750915-3105-1-git-send-email-divya.indi@oracle.com \
    --to=divya.indi@oracle.com \
    --cc=ashish.samant@oracle.com \
    --cc=bo.li.liu@oracle.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).