linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Lakshmipathi.G" <lakshmipathi.g@giis.co.in>
To: Goffredo Baroncelli <kreijack@inwind.it>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: How to dump/find parity of RAID-5 file?
Date: Thu, 16 Feb 2017 20:44:09 +0530	[thread overview]
Message-ID: <20170216151409.GA10977@giis.co.in> (raw)
In-Reply-To: <bfe89355-f549-7bda-ff0c-428c8b4ca4ed@inwind.it>

On Wed, Feb 15, 2017 at 07:24:55PM +0100, Goffredo Baroncelli wrote:
> The chunk-tree maps the logical address [145096704...145096704+134217728) [size=128MB] to the physical ones 
> 	devid3 : [63111168..63111168+67108864) [size=64MB]
> 	devid1 : [63111168..63111168+67108864) [size=64MB]
> 	devid2 : [83034112..83034112+67108864) [size=64MB]
> 
> So because the logical address is divided in pieces of 64k, interleaved by the parity, we know that:
> * first 128kb
> logical address [145096704      ..145096704+64k)   -> devid1, [63111168    ..63111168+64k)
> logical address [145096704+64k  ..145096704+2x64k) -> devid2, [83034112    ..83034112+64k)
>                 parity:                            -> devid3, [63111168    ..63111168+64k)
> * second 128kb
> logical address [145096704+2x64k..145096704+3x64k) -> devid2, [83034112+64k..83034112+2x64k)
> logical address [145096704+3x64k..145096704+4x64k) -> devid3, [63111168+64k..63111168+2x64k)
>                 parity:                            -> devid1, [63111168+64k..63111168+2x64k)
> And so on...
> 
> (NB: 145096704+2x64k == 145227776)
> 
> The fs-tree, maps the file content [0..131072) [size=128k] to the logical address [145227776..145227776+131072) [size=128k]
> 
> So the file content is stored starting from the disk devid2, at 83034112+64k=83099648 (first 64k). The second 64k is placed in disk devid3 at 63111168+64k=63176704; the parity is stored at disk1, 63111168+64k = 63176704
> 
> 
> BR
> G.Baroncelli
> 

Thanks for the detailed example with exact numbers. Now understood the address mapping better. With this as a reference, I think
it should be possible to access parity/data-stripes more sensible manner instead using expensive "cat /device/ | hexdump | grep"
combination. thanks.

Cheers.
Lakshmipathi.G

  reply	other threads:[~2017-02-16 15:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-03 10:44 How to dump/find parity of RAID-5 file? Lakshmipathi.G
2017-02-06 20:40 ` Goffredo Baroncelli
2017-02-14 20:09   ` Lakshmipathi.G
2017-02-15 18:24     ` Goffredo Baroncelli
2017-02-16 15:14       ` Lakshmipathi.G [this message]
2018-04-17 19:20   ` Goffredo Baroncelli
     [not found] ` <8c5cece7-29cf-82df-0739-ef4f0fe8bf70@cn.fujitsu.com>
2017-02-14 20:06   ` Lakshmipathi.G

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=20170216151409.GA10977@giis.co.in \
    --to=lakshmipathi.g@giis.co.in \
    --cc=kreijack@inwind.it \
    --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).