linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.de>
To: Eyal Lebedinsky <eyal@eyal.emu.id.au>
Cc: list linux-raid <linux-raid@vger.kernel.org>
Subject: Re: how to handle bad sectors in md control areas?
Date: Mon, 3 Mar 2014 08:42:45 +1100	[thread overview]
Message-ID: <20140303084245.5b329a9a@notabene.brown> (raw)
In-Reply-To: <53108DEF.7030904@eyal.emu.id.au>

[-- Attachment #1: Type: text/plain, Size: 2290 bytes --]

On Sat, 01 Mar 2014 00:23:59 +1100 Eyal Lebedinsky <eyal@eyal.emu.id.au>
wrote:

> Thanks Piergiorgio,
> 
> I did search before, unsuccessfully. I repeated now with different keywords and found
> this entry in the kernel wiki
> 	https://raid.wiki.kernel.org/index.php/RAID_superblock_formats
> 
> It documents the initial fixed fields of the superblock. I still do not know how
> the intent bitmap is laid out. I can see that it starts 4KB into the superblock:
> 	Internal Bitmap : 8 sectors from superblock
> but did not yet find its size (which I expect depends on the array size).
> 
> I guess I can calculate it from the sys/block/md127/md items
> 	component_size * 1024 / 'bitmap/chunksize' / 8
> which comes up to 7452 bytes which is still a small fraction of the 128MB header size.
> 
> What else is there? bad blocks list? Reading an old blog (from Neil) suggests that it
> is not larger than 32KB (but is only 4KB now), so still "small" in this context.
> Don't know where it resides though.
> 
> I need to understand the full layout of the header and so far I do not see anything that
> says what the area past the initial 16KB is used (is always zero when I inspect it).
> I started a heavy file copy on the raid and watched the header and never saw any change.
> I expected to see at least some activity in the bitmap but none encountered.
> 
> My simple question is: is it the case that the reserved header space after 16KB is
> actually still unused in header version 1.2? My bad sector is practically at the end
> of this 128MB area. A trivial question to answer for someone with expert knowledge
> of md.
> 
> Anyone?

The location of the superblock is reported by "mdadm --exmamine".
The size is 4K (Though most of that is unsed).
The location of the bitmap (if present) is reported by "mdadm --examine"
as an offset from the superblock.  It size can be deduced from the output
of "mdadm --examine-bitmap".  Take the number of bits, divide by 8, add 256
and round up to a multiple of 512.  This number is bytes.
The location of the bad-block-log (if present) is reported by "mdadm
--examine" as an offset from the superblocks.  It's size if 4K.
Any other space outside of the data region is currently unused by md.

NeilBrown


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

  reply	other threads:[~2014-03-02 21:42 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-26  8:16 how to handle bad sectors in md control areas? Eyal Lebedinsky
2014-02-28  1:35 ` Eyal Lebedinsky
2014-02-28 10:53   ` Piergiorgio Sartor
2014-02-28 13:23     ` Eyal Lebedinsky
2014-03-02 21:42       ` NeilBrown [this message]
2014-03-02  0:56 ` Eyal Lebedinsky
2014-03-02 13:25 ` Peter Grandi
2014-03-02 21:38 ` NeilBrown
2014-03-02 22:21   ` Eyal Lebedinsky

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=20140303084245.5b329a9a@notabene.brown \
    --to=neilb@suse.de \
    --cc=eyal@eyal.emu.id.au \
    --cc=linux-raid@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).