linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Doug Ledford <dledford@redhat.com>
To: Ben DJ <bendj095124367913213465@gmail.com>
Cc: Michael Evans <mjevans1983@gmail.com>, linux-raid@vger.kernel.org
Subject: Re: Clarify /etc/mdadm.conf format and content?
Date: Sat, 07 Nov 2009 12:06:40 -0500	[thread overview]
Message-ID: <4AF5A920.1020601@redhat.com> (raw)
In-Reply-To: <babafd2f0911050824u327c2ca3y43ab557b52f9356@mail.gmail.com>

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

On 11/05/2009 11:24 AM, Ben DJ wrote:
> On Wed, Nov 4, 2009 at 11:31 PM, Michael Evans <mjevans1983@gmail.com> wrote:
>> To better cooperate with various initrd and recovery cd you should
>> probably use a numeric only array name, as well as the /dev/mdX
>> numbering scheme.
> 
> Ok.  That still doesn't address why different commands in mdadm
> generate different numbering schemes.

The answer to that is technical implementation details.  Specifically,
mdadm -D examines the actual raid array you pass in on the command line.
 Since the array is up and running, it knows *exactly* what you want the
name to be because it's already using it.  For mdadm -E, it examines the
superblock on the constituent device.  That superblock only has the name
field to tell it what the device name is (and what it gets assembled as
could be totally different if the mdadm.conf file spelled out that uuid
as having another name).  So, it reports what the mdadm standard name
would be if it were assembled without an mdadm.conf entry to tell it
what it's supposed to be.

> How do I change the name= spec'n?  Do I simply add something to
> /etc/mdadm.conf and reboot?  Or do I need to init3, stop the LVM, stop
> the array, assemble-with-update, change in mdadm.conf, then ,
> re-mkinitrd?  Or, since mdadm.conf is ON root ON the arary do I need
> to boot from a rescue disk, then complete all the steps?

When running mdadm -D or -E, the name it outputs is more informative
than anything else.  If you save that output to mdadm.conf, then edit
the ARRAY line to use another name, that name in the array line will
trump the name produced by either mdadm -D or mdadm -E.  So, if you
actually want to change the name of the array as it stands each time you
boot up the machine, then you need to edit the mdadm.conf file to put
the new name in, you need to edit the fstab file and change any
references to the old name to the new name, you need to edit the
grub.conf file (or if you have a different boot loader then the config
file for whatever boot loader that it) and likewise change all
references of the old name to the new name, and finally you will likely
need to remake your initrd images so that they contain the updated
mdadm.conf file and the updated name references.

Now, if you are talking about just changing the name of the array in the
superblock, but leaving how it's referenced alone, then you can assemble
the array with the --update=name option and specify the new name.  As I
pointed out, this doesn't actually change what name the array gets
created as.  The ARRAY line in mdadm.conf controls that.  However, be
warned that if the ARRAY line in mdadm.conf references the old name,
then now assembly will fail to work because you'll match the UUID of the
array, but not the name, and mdadm will throw it out.  So, if the name=
option is in your mdadm.conf ARRAY line for the array, then changing the
name of the array will require that you do everything I listed above to
update the mdadm.conf file in your mkinitrds and such or else the system
won't boot after you update the name in the superblock.  One last thing,
if this is a / array, then since the only way to update the name is
during assembly, you would have to boot the system from rescue CD and
assemble the array by hand, or else modify the init script in an initrd
image to do the update for you.  Neither of which is a necessarily easy
task if you don't know what you are doing.


-- 
Doug Ledford <dledford@redhat.com>
              GPG KeyID: CFBFF194
	      http://people.redhat.com/dledford

Infiniband specific RPMs available at
	      http://people.redhat.com/dledford/Infiniband


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

  parent reply	other threads:[~2009-11-07 17:06 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-05  5:53 Clarify /etc/mdadm.conf format and content? Ben DJ
2009-11-05  6:17 ` Michael Evans
2009-11-05  7:21   ` Ben DJ
2009-11-05  7:31     ` Michael Evans
2009-11-05 16:24       ` Ben DJ
2009-11-05 17:03         ` Ben DJ
2009-11-09  4:57           ` Neil Brown
2009-11-10  0:11             ` Michael Evans
2009-11-12  1:05               ` Ben DJ
2009-11-07 17:06         ` Doug Ledford [this message]
2009-11-12  0:48           ` Ben DJ

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=4AF5A920.1020601@redhat.com \
    --to=dledford@redhat.com \
    --cc=bendj095124367913213465@gmail.com \
    --cc=linux-raid@vger.kernel.org \
    --cc=mjevans1983@gmail.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).