linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Neil Brown <neilb@suse.de>
To: Piergiorgio Sartor <piergiorgio.sartor@nexgo.de>
Cc: linux-raid@vger.kernel.org
Subject: Re: Detecting array parameters
Date: Thu, 10 Jun 2010 08:31:12 +1000	[thread overview]
Message-ID: <20100610083112.47aa2200@notabene.brown> (raw)
In-Reply-To: <20100609211340.GA12172@lazy.lzy>

On Wed, 9 Jun 2010 23:13:40 +0200
Piergiorgio Sartor <piergiorgio.sartor@nexgo.de> 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.
> 
> 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...?
> 
> Assuming the wanted information is available on both
> sides, which does not seem always the case.

If it is available in 
   mdadm --detail --export

I would use that.
Otherwise probably go for
   /sys/class/block/mdX/md/...

I say /sys/class/block rather than /sys/block as there are rumours of
deprecating /sys/block.  Don't know if that will ever happen though.

NeilBrown

  reply	other threads:[~2010-06-09 22:31 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 [this message]
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

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=20100610083112.47aa2200@notabene.brown \
    --to=neilb@suse.de \
    --cc=linux-raid@vger.kernel.org \
    --cc=piergiorgio.sartor@nexgo.de \
    /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).