Re: Clarify /etc/mdadm.conf format and content?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11/05/2009 11:24 AM, Ben DJ wrote:
> On Wed, Nov 4, 2009 at 11:31 PM, Michael Evans <mjevans1983@xxxxxxxxx> 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@xxxxxxxxxx>
              GPG KeyID: CFBFF194
	      http://people.redhat.com/dledford

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

Attachment: signature.asc
Description: OpenPGP digital signature


[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux