linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael Tokarev <mjt@tls.msk.ru>
To: Lajber Zoltan <lajbi@lajli.gau.hu>
Cc: "Torsten E." <linux-user@gmx.com>, linux-raid@vger.kernel.org
Subject: Re: Question regarding mdadm.conf
Date: Thu, 17 Feb 2005 10:14:32 +0300	[thread overview]
Message-ID: <42144458.4040306@tls.msk.ru> (raw)
In-Reply-To: <Pine.LNX.4.58.0502170748160.15568@lajli.gau.hu>

Lajber Zoltan wrote:
> Hi!
> 
> On Thu, 17 Feb 2005, Torsten E. wrote:
> 
> 
>>How does I get those UUID information, to add them to the new
>>/etc/mdadm.conf?
> 
> Try this one: mdadm --detail /dev/md1 | grep UUID

I'd say

   mdadm --detail --brief /dev/md1 | grep -v devices=

-- this will give you all information necessary for mdadm.conf,
you can just redirect output into that file.

Note the grep usage.  Someone will disagree with me here, but
there is a reason why to remove devices= line.  Without it,
output from mdadm looks like (on my system anyway):

ARRAY /dev/md1 level=raid1 num-devices=4 UUID=11e92e45:15fcc4a0:cf62e981:a79de494
    devices=/dev/sda1,/dev/sdb1,/dev/sdc1,/dev/sdd1

Ie, it lists all the devices which are parts of the array.
The problem with this is: if, for any reason (dead drive,
adding/removing drives/controllers etc) the devices will
change, and some /dev/sdXY will point to another device wich
is a part of some other raid array, mdadm will refuse to
assemble this array, saying something in a line of "the
UUIDs does not match, aborting".  Without the "devices="
part but with --scan option, mdadm will search all devices
by its own (based on the DEVICE line in mdadm.conf) - this
is somewhat slower as it will try to open each device in
turn, but safer, as it will find all the present components
no matter what.

Someone correct me if I'm wrong... ;)

/mjt

  reply	other threads:[~2005-02-17  7:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-17  6:25 Question regarding mdadm.conf Torsten E.
2005-02-17  6:48 ` Lajber Zoltan
2005-02-17  7:14   ` Michael Tokarev [this message]
2005-02-17  8:23     ` Torsten E.
2005-02-17  8:44       ` Guy
2005-02-17 11:11         ` GrantC
2005-02-17  8:30     ` Bad blocks Guy

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=42144458.4040306@tls.msk.ru \
    --to=mjt@tls.msk.ru \
    --cc=lajbi@lajli.gau.hu \
    --cc=linux-raid@vger.kernel.org \
    --cc=linux-user@gmx.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).