linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Piergiorgio Sartor <piergiorgio.sartor@nexgo.de>
To: Leslie Rhorer <lrhorer@satx.rr.com>
Cc: 'Piergiorgio Sartor' <piergiorgio.sartor@nexgo.de>,
	linux-raid@vger.kernel.org
Subject: Re: Detecting array parameters
Date: Sat, 12 Jun 2010 11:59:53 +0200	[thread overview]
Message-ID: <20100612095953.GB14727@lazy.lzy> (raw)
In-Reply-To: <A4.C2.03943.B9F611C4@cdptpa-omtalb.mail.rr.com>

Hi,

thanks for the answer.

By "both sides" I mean the "mdadm -D/-E" (one) and the
/sys/class/block/mdX/md (the other).

Some information is available with "mdadm -D", some other
is available in the sysfs.

bye,

pg

On Thu, Jun 10, 2010 at 06:04:48PM -0500, Leslie Rhorer wrote:
> > Hi,
> > 
> > if I understood it correctly, in order to detect
> > the several array parameters (number of disks, for
> > example), it is possible to use "mdadm -D /dev/mdX"
> > or to check the files in the corresponding /sys/block/...
> > /mdX/... files.
> 
> 	Yes, but only if the array is assembled.  If not, it's "-E", not
> "-D", and the target is a member device, not the array.
> 
> > Now, assuming something needs to be done in scripts,
> > what would be the best way? Using "mdadm -D ... | grep"
> > (or "mdadm ... | gawk ...."), or to read the proper
> > files in /sys/block/md...?
> 
> 	That depends on what you need to do.  If you need to obtain in depth
> information about the array and / or act only upon specific contents of a
> line in  the output, then you need to use gawk.  If your script merely takes
> action based upon the existence of some meta-content of the output, then
> grep or even grep -q may be the better choice.
> 
> > Assuming the wanted information is available on both
> > sides, which does not seem always the case.
> 
> 	I don't know what you mean by "both sides".
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-raid" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 

piergiorgio

      reply	other threads:[~2010-06-12  9:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-09 21:13 Detecting array parameters Piergiorgio Sartor
2010-06-09 22:31 ` Neil Brown
2010-06-12  9:58   ` Piergiorgio Sartor
2010-06-17  5:52     ` Neil Brown
2010-06-10 23:04 ` Leslie Rhorer
2010-06-12  9:59   ` Piergiorgio Sartor [this message]

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=20100612095953.GB14727@lazy.lzy \
    --to=piergiorgio.sartor@nexgo.de \
    --cc=linux-raid@vger.kernel.org \
    --cc=lrhorer@satx.rr.com \
    /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).