linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Neil Brown <neilb@suse.de>
To: Wakko Warner <wakko@animx.eu.org>
Cc: linux-raid@vger.kernel.org
Subject: Re: Device state during an incremental assembly
Date: Mon, 22 Nov 2010 07:58:40 +1100	[thread overview]
Message-ID: <20101122075840.1153b020@notabene.brown> (raw)
In-Reply-To: <20101121144159.GB29163@animx.eu.org>

On Sun, 21 Nov 2010 09:41:59 -0500
Wakko Warner <wakko@animx.eu.org> wrote:

> > > I am not on this list, please always CC me.
> 
> I am now.
> 
> > > Is there anyway to determine the array state after incrementally adding a
> > > device?  I was hoping to find something in /sys but I was unable to.  I was
> > > trying not to parse the output of mdadm for each invocation.
> 
> > Yes.
> 
> > Note: if you don't find that there is enough detail in this answer, it
> > simply
> > reflects the level of detail in the question :-)
> 
> I've been playing with incremental assembly on a test system and wanted to
> have a way of knowing if the md device was in a state that it could be
> started.  I'm working with a script that will assemble arrays for me and
> possibly query if an array should be started if it hasn't.
> 
> For instance.
> 
> Lets say that I have a 4 disk array (In my case, raid level is really of no
> importance, but if we must, assume this is raid5).  The array was setup as
> /dev/md0.
> 
> I run mdadm -I /dev/sda1
> 
> Obviously, this is not enough to start the array even in degraded mode.  At
> this point, is there a way to know if the array could be started and usable
> without parsing the output of mdadm?
> 
> Next, mdadm -I /dev/sdb1
> Still not enough.
> Next, mdadm -I /dev/sdc1
> At this point, I could start the array in degraded.  This is what I'd like
> to beable to query from beneath /sys/block/md0 or some where else.

Ahh.. In this case the answer is actually "no" - sorry.

The answer is a non-trivial function of:
  the raid level
  the number of available non-spare devices
  (for raid10) which slots the available non-spare devices fill.

All of this information is available in sysfs, and mdadm has code to perform
the computation and then take appropriate action.  But there is no simple way
to get this information.

Why do you want this information?  What action will you take depending on the
answer?
If you just want mdadm to assemble as soon a a degraded array is possible,
just use "mdadm -IR" - but I suspect you already know that.


> 
> And of course, mdadm -I /dev/sdd1
> makes the array fully active.
> 
> P.S. cantor2.suse.de[195.135.220.15] does pipelining even if pipelining
> wasn't performed.
I'm guessing this is a statement about SMTP? This would be why I got a bounce
 <wakko@animx.eu.org>: host veg.animx.eu.org[76.7.162.186] said: 554 SMTP
    synchronization error (in reply to MAIL FROM command)
to my original mail.
I guess suse.de is not being conservative in what it sends, and animx is not
being liberal in what it accepts...  Do you know what mail system is in use
on animx??

NeilBrown



> 


  reply	other threads:[~2010-11-21 20:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-20  1:52 Device state during an incremental assembly Wakko Warner
2010-11-21  6:19 ` Neil Brown
2010-11-21 14:41   ` Wakko Warner
2010-11-21 20:58     ` Neil Brown [this message]
2010-11-21 22:45       ` Wakko Warner
2010-11-21 23:19         ` Neil Brown
2010-11-22  1:39           ` Wakko Warner

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=20101122075840.1153b020@notabene.brown \
    --to=neilb@suse.de \
    --cc=linux-raid@vger.kernel.org \
    --cc=wakko@animx.eu.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).