All of lore.kernel.org
 help / color / mirror / Atom feed
* Clarify /etc/mdadm.conf format and content?
@ 2009-11-05  5:53 Ben DJ
  2009-11-05  6:17 ` Michael Evans
  0 siblings, 1 reply; 11+ messages in thread
From: Ben DJ @ 2009-11-05  5:53 UTC (permalink / raw)
  To: linux-raid

Hi,

I've two arrays, "/boot" on RAID-1 & "/, etc" on LVM on RAID-10.

I currently have,

cat /etc/mdadm.conf
  DEVICE partitions
  ARRAY /dev/md0 metadata=1.00 name=Rescue:0
UUID=864b9359:09f5f39b:69a4ae8a:e3d794f8
  ARRAY /dev/md1 metadata=1.01 name=Rescue:1
UUID=6d541863:4e7235a3:81291c4d:b7f4b48c


Couple of questions.

(1) What's the "Rescue" in the name field?  Does it matter what the
name is?  I _thought_ name was derived from hostname ... ?

(2) For re-populating /etc/mdadm, should I use the output of,

  mdadm --detail --scan

or,

  mdadm --examine --scan


The two have different device names -- note "/dev/mdX" vs"/dev/md/X",

mdadm --detail --scan > tmp.txt
cat tmp.txt
  ARRAY /dev/md1 metadata=1.01 name=Rescue:1
UUID=6d541863:4e7235a3:81291c4d:b7f4b48c
  ARRAY /dev/md0 metadata=1.00 name=Rescue:0
UUID=864b9359:09f5f39b:69a4ae8a:e3d794f8

mdadm --examine --scan
  ARRAY /dev/md/0 metadata=1.0
UUID=864b9359:09f5f39b:69a4ae8a:e3d794f8 name=Rescue:0
  ARRAY /dev/md/1 metadata=1.1
UUID=6d541863:4e7235a3:81291c4d:b7f4b48c name=Rescue:1

(3) my RAID-10 has --layout=f2 & --chunk=256.  Should either of those
specs be included in the /etc/mdadm.conf?

Thanks,

BenDJ

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Clarify /etc/mdadm.conf format and content?
  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
  0 siblings, 1 reply; 11+ messages in thread
From: Michael Evans @ 2009-11-05  6:17 UTC (permalink / raw)
  To: Ben DJ; +Cc: linux-raid

Short version:
Try running 'man mdadm.conf'  If that doesn't produce a manual page
please follow this link:

http://man-wiki.net/index.php/5:mdadm.conf

Long version:
Rescue is probably the name of the last system to update the
meta-data, either a rescue cd / system used for recovery or setup.

The normal mdadm manual page should elaborate the use of these options:

       -U, --update=homehost
       --auto-update-homehost

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Clarify /etc/mdadm.conf format and content?
  2009-11-05  6:17 ` Michael Evans
@ 2009-11-05  7:21   ` Ben DJ
  2009-11-05  7:31     ` Michael Evans
  0 siblings, 1 reply; 11+ messages in thread
From: Ben DJ @ 2009-11-05  7:21 UTC (permalink / raw)
  To: Michael Evans; +Cc: linux-raid

Hi,

On Wed, Nov 4, 2009 at 10:17 PM, Michael Evans <mjevans1983@gmail.com> wrote:
>       -U, --update=homehost
>       --auto-update-homehost

The man pages suggest what to do when assembling/creating the array.

Since I've _got_ arrays already created, that are auto-assembled using
the info IN mdadm.conf, I'm unclear as to how to change/correct the
name= field.  Can you clarify?

To my other question, http://man-wiki.net/index.php/8:mdadm#DEVICE_NAMES says,

 The standard names for non-partitioned arrays  (the  only  sort  of  md
      array available in 2.4 and earlier) either of

             /dev/mdNN
             /dev/md/NN

      where  NN is a number.  The standard names for partitionable arrays (as
      available from 2.6 onwards) is one of

             /dev/md/dNN
             /dev/md_dNN


Since my arrays are each a single partition (the RAID-10 has LVMs on
the single partition), I guess that the "either of"

             /dev/mdNN
             /dev/md/NN

applies?  And, even if so, why do mdadm --examine & mdadm --detail use
_different_ output formats?

BenDJ
--
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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Clarify /etc/mdadm.conf format and content?
  2009-11-05  7:21   ` Ben DJ
@ 2009-11-05  7:31     ` Michael Evans
  2009-11-05 16:24       ` Ben DJ
  0 siblings, 1 reply; 11+ messages in thread
From: Michael Evans @ 2009-11-05  7:31 UTC (permalink / raw)
  To: Ben DJ; +Cc: linux-raid

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.

You should read the manuals more carefully, it is possible to update
the name and/or homehost name for arrays DURING ASSEMBLY using the
update option, hence my reference to the manual.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Clarify /etc/mdadm.conf format and content?
  2009-11-05  7:31     ` Michael Evans
@ 2009-11-05 16:24       ` Ben DJ
  2009-11-05 17:03         ` Ben DJ
  2009-11-07 17:06         ` Doug Ledford
  0 siblings, 2 replies; 11+ messages in thread
From: Ben DJ @ 2009-11-05 16:24 UTC (permalink / raw)
  To: Michael Evans; +Cc: linux-raid

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.

> You should read the manuals more carefully, it is possible to update
> the name and/or homehost name for arrays DURING ASSEMBLY using the
> update option, hence my reference to the manual.

I read the man pages.  I don't understand what's written there.  I'm
asking questions about it here.

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?

Can you please be less cryptic and share what you seem to know, rather
than telling me to RTFM?  If you can't or won't, that's fine.  Just
say so, and I'll wait for other help.

Thanks.

BenDJ

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Clarify /etc/mdadm.conf format and content?
  2009-11-05 16:24       ` Ben DJ
@ 2009-11-05 17:03         ` Ben DJ
  2009-11-09  4:57           ` Neil Brown
  2009-11-07 17:06         ` Doug Ledford
  1 sibling, 1 reply; 11+ messages in thread
From: Ben DJ @ 2009-11-05 17:03 UTC (permalink / raw)
  To: Neil Brown; +Cc: linux-raid

Neil,

Reading your blog post,

  "Auto-assembly mode for mdadm"
   http://neil.brown.name/blog/20060521092609

Section "Bootstrapping" says

-------------
On problem with introducing this functionality is that people have
pre-existing array that aren't tagged with the host name. To help we
this we will have a new 'update' option of --assemble:
--update=homehost which will update the host information in the
superblock prior to assembly. This is usable fairly easily for
everything except an array holding a root filesystem. In order to
avoid needing to boot from different media, there will be an option
that can safely be used from an initramfs which will do the right
thing.

This will probably be called --auto-update-home-host.

This option is only meaningful when doing a hostname based auto
assembly. If the autoassembly process finds anything to assemble, the
option is ignored. However if nothing is found with the right host
name, then a second pass is made. On this pass, any md array that is
found is updated to belong to the current host, and is automatically
assembled.

Thus it should be safe to always run mdadm with
--auto-update-home-host in initramfs. It will only do its magic once,
and after that the arrays should always assemble properly.
-------------

That describes the situation I have -- an array holding the root file
system, that's not tagged with the hostname.

Can you please explain HOW one runs "with --auto-update-home-host in
initramfs" "to avoid needing to boot from different media"?  My
existing arrays are tagged with the wrong name, and I'm simply trying
to correct it.

Thanks,

BenDJ

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Clarify /etc/mdadm.conf format and content?
  2009-11-05 16:24       ` Ben DJ
  2009-11-05 17:03         ` Ben DJ
@ 2009-11-07 17:06         ` Doug Ledford
  2009-11-12  0:48           ` Ben DJ
  1 sibling, 1 reply; 11+ messages in thread
From: Doug Ledford @ 2009-11-07 17:06 UTC (permalink / raw)
  To: Ben DJ; +Cc: Michael Evans, linux-raid

[-- 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 --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Clarify /etc/mdadm.conf format and content?
  2009-11-05 17:03         ` Ben DJ
@ 2009-11-09  4:57           ` Neil Brown
  2009-11-10  0:11             ` Michael Evans
  0 siblings, 1 reply; 11+ messages in thread
From: Neil Brown @ 2009-11-09  4:57 UTC (permalink / raw)
  To: Ben DJ; +Cc: linux-raid

On Thursday November 5, bendj095124367913213465@gmail.com wrote:
> Neil,
> 
> Reading your blog post,
> 
>   "Auto-assembly mode for mdadm"
>    http://neil.brown.name/blog/20060521092609
> 
> Section "Bootstrapping" says
> 
> -------------
> On problem with introducing this functionality is that people have
> pre-existing array that aren't tagged with the host name. To help we
> this we will have a new 'update' option of --assemble:
> --update=homehost which will update the host information in the
> superblock prior to assembly. This is usable fairly easily for
> everything except an array holding a root filesystem. In order to
> avoid needing to boot from different media, there will be an option
> that can safely be used from an initramfs which will do the right
> thing.
> 
> This will probably be called --auto-update-home-host.
> 
> This option is only meaningful when doing a hostname based auto
> assembly. If the autoassembly process finds anything to assemble, the
> option is ignored. However if nothing is found with the right host
> name, then a second pass is made. On this pass, any md array that is
> found is updated to belong to the current host, and is automatically
> assembled.
> 
> Thus it should be safe to always run mdadm with
> --auto-update-home-host in initramfs. It will only do its magic once,
> and after that the arrays should always assemble properly.
> -------------
> 
> That describes the situation I have -- an array holding the root file
> system, that's not tagged with the hostname.
> 
> Can you please explain HOW one runs "with --auto-update-home-host in
> initramfs" "to avoid needing to boot from different media"?  My
> existing arrays are tagged with the wrong name, and I'm simply trying
> to correct it.

You would need to modify the initramfs ... or get it to give you a
shell prompt so you can run the commands by hand.
The details of doing this depend very much on the distro and the
content of the initramfs it creates.

If you want to change the name in an array that hold your root
filesystem, your best approach would be to boot from a CDROM and 
then use e.g.
   mdadm --assemble /dev/md --update=name --name=foo:bar  /dev/list-of-devices

NeilBrown

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Clarify /etc/mdadm.conf format and content?
  2009-11-09  4:57           ` Neil Brown
@ 2009-11-10  0:11             ` Michael Evans
  2009-11-12  1:05               ` Ben DJ
  0 siblings, 1 reply; 11+ messages in thread
From: Michael Evans @ 2009-11-10  0:11 UTC (permalink / raw)
  To: Neil Brown; +Cc: Ben DJ, linux-raid

You might be interested in a project I was working on.  Arch linux
already has something similar, I added it to Gentoo's sunrise overlay,
and the other major distros are too intimidating to submit it to
without better integration, which I've little inclination to work on
without a known path for inclusion.

It builds an initramfs and/or initrd using local binaries and is very
easy to customize since it builds the image within a subfolder.  You
can even chroot in to it and run informational only checks to make
sure you've included the things you'll want.  Plus you can work in a
subshell and then 'exit' to make a change like this or run an fsck
before early-userspace ends.

https://sourceforge.net/projects/aeuio

If it doesn't work please let me know so I can resolve the error.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Clarify /etc/mdadm.conf format and content?
  2009-11-07 17:06         ` Doug Ledford
@ 2009-11-12  0:48           ` Ben DJ
  0 siblings, 0 replies; 11+ messages in thread
From: Ben DJ @ 2009-11-12  0:48 UTC (permalink / raw)
  To: Doug Ledford; +Cc: linux-raid

On Sat, Nov 7, 2009 at 9:06 AM, Doug Ledford <dledford@redhat.com> wrote:
>> Ok.  That still doesn't address why different commands in mdadm
>> generate different numbering schemes.
>
> The answer to that is technical implementation details.
<snip>

Ok, that's clear now.

>> How do I change the name= spec'n? ...

...
> 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.

Whew.  Messy, but once again clear.

Thanks for the help.

BenDJ
--
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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Clarify /etc/mdadm.conf format and content?
  2009-11-10  0:11             ` Michael Evans
@ 2009-11-12  1:05               ` Ben DJ
  0 siblings, 0 replies; 11+ messages in thread
From: Ben DJ @ 2009-11-12  1:05 UTC (permalink / raw)
  To: linux-raid; +Cc: Neil Brown, Michael Evans

On Sun, Nov 8, 2009 at 8:57 PM, Neil Brown <neilb@suse.de> wrote:
> You would need to modify the initramfs ... or get it to give you a
> shell prompt so you can run the commands by hand.
> The details of doing this depend very much on the distro and the
> content of the initramfs it creates.

On Mon, Nov 9, 2009 at 4:11 PM, Michael Evans <mjevans1983@gmail.com> wrote:
> You might be interested in a project I was working on. ...

I'm currently on openSUSE 11.2.

I'm going to read/follow Doug's procedure above.  It seems a little
odd that at some point in my messing around, the arrays "got named" to
the "Rescue" disk without any intended interaction on my part, but
that changing it back seems "involved" with the possibility to screw
things up royally.

Thanks.

BenDJ

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2009-11-12  1:05 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2009-11-12  0:48           ` Ben DJ

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.