linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hans van Kranenburg <hans.van.kranenburg@mendix.com>
To: David Sterba <dsterba@suse.com>, linux-btrfs@vger.kernel.org
Cc: David Sterba <dsterba@suse.cz>
Subject: Re: [RFC][PATCH] btrfs-progs: inspect: new subcommand to dump chunks
Date: Thu, 23 Jun 2016 03:10:09 +0200	[thread overview]
Message-ID: <59a806a2-262e-42fe-404a-328569901055@mendix.com> (raw)
In-Reply-To: <1466616406-28087-1-git-send-email-dsterba@suse.com>

On 06/22/2016 07:26 PM, David Sterba wrote:
> From: David Sterba <dsterba@suse.cz>
>
> Hi,
>
> the chunk dump is a useful thing, for debugging or balance filters.
>
> Example output:
>
> Chunks on device id: 1
> PNumber            Type        PStart        Length          PEnd     Age         LStart  Usage
> -----------------------------------------------------------------------------------------------
>       0   System/RAID1        1.00MiB      32.00MiB      33.00MiB      47        1.40TiB   0.06
>       1 Metadata/RAID1       33.00MiB       1.00GiB       1.03GiB      31        1.36TiB  64.03
>       2 Metadata/RAID1        1.03GiB      32.00MiB       1.06GiB      36        1.36TiB  77.28
>       3     Data/single       1.06GiB       1.00GiB       2.06GiB      12      422.30GiB  78.90
>       4     Data/single       2.06GiB       1.00GiB       3.06GiB      11      420.30GiB  78.47
> ...

On RAID0, it looks funny :)

# ./btrfs inspect-internal dump-chunks /mnt/extents/
Chunks on device id: 1
PNumber            Type        PStart        Length          PEnd Age         LStart
----------------------------------------------------------------------------------------
       0 Metadata/RAID0        1.00MiB     256.00MiB     257.00MiB 1       13.36GiB
       .           empty             .      16.00EiB             .  .              .
       1   System/RAID0      129.00MiB      64.00MiB     193.00MiB 2       13.61GiB
       .           empty             .      16.00EiB             .  .              .
       2     Data/RAID0      161.00MiB       2.00GiB       2.16GiB 3       15.68GiB
       .           empty             .     115.00MiB             .  .              .
       3     Data/RAID0        2.27GiB       2.00GiB       4.27GiB 0       11.36GiB

Chunks on device id: 2
PNumber            Type        PStart        Length          PEnd 
Age         LStart
----------------------------------------------------------------------------------------
       0     Data/RAID0        1.00MiB       2.00GiB       2.00GiB 0       11.36GiB
       .           empty             .      16.00EiB             .  .              .
       1 Metadata/RAID0        1.00GiB     256.00MiB       1.25GiB 1       13.36GiB
       .           empty             .      16.00EiB             .  .              .
       2   System/RAID0        1.13GiB      64.00MiB       1.19GiB 2       13.61GiB
       .           empty             .      16.00EiB             .  .              .
       3     Data/RAID0        1.16GiB       2.00GiB       3.16GiB 3       15.68GiB

For the correct sizes, it would be needed to either do some math, like 
if RAID0 then divide by 2, but I guess this gets horrible really soon 
with RAID5 etc... Or, if you want to print everything in the physical 
order, why not just dump the device tree with DEV_EXTENT which has the 
exact length on disk, and fill in the missing information using the 
reference to the chunk they belong to?

https://github.com/knorrie/python-btrfs/commit/be85c2a0e2774909b532326e99e0c23ab8467263

Sorry, couldn't resist /:D\

-- 
Hans van Kranenburg - System / Network Engineer
T +31 (0)10 2760434 | hans.van.kranenburg@mendix.com | www.mendix.com

  parent reply	other threads:[~2016-06-23  1:10 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-22 17:26 [RFC][PATCH] btrfs-progs: inspect: new subcommand to dump chunks David Sterba
2016-06-22 22:20 ` Hans van Kranenburg
2016-06-23 13:13   ` David Sterba
2016-06-23 13:17     ` Hans van Kranenburg
2016-06-23  1:10 ` Hans van Kranenburg [this message]
2016-06-23 13:27   ` David Sterba
2016-06-23  1:20 ` Qu Wenruo
2016-06-23 13:07   ` David Sterba
2016-06-23  1:53 ` Liu Bo
2016-06-23 12:43   ` David Sterba

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=59a806a2-262e-42fe-404a-328569901055@mendix.com \
    --to=hans.van.kranenburg@mendix.com \
    --cc=dsterba@suse.com \
    --cc=dsterba@suse.cz \
    --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).