All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joe Landman <joe.landman@gmail.com>
To: "linux-raid@vger.kernel.org List" <linux-raid@vger.kernel.org>
Subject: Re: Is mdadm.conf needed?
Date: Fri, 07 Mar 2014 15:13:55 -0500	[thread overview]
Message-ID: <531A2883.1000100@gmail.com> (raw)
In-Reply-To: <B13575D2-B437-4C38-9A31-E58CCE72F189@colorremedies.com>

On 03/07/2014 03:00 PM, Chris Murphy wrote:
>
> On Mar 6, 2014, at 7:13 PM, Martin T <m4rtntns@gmail.com> wrote:
>
>> Hi,
>>
>> while most of the Linux software-RAID related tutorials suggest to
>> have the mdadm.conf file up to date, then is it actually needed or
>> used any more? I mean all the data needed by kernel for creating
>> the RAID arrays should be stored in the superblocks, shouldn't it?
>> Or in which situation the mdadm.conf is needed?
>
> Good question. mdadm.conf is baked into the initramfs by dracut,
> along with mdadm, on Fedora systems. I haven't tried to willfully
> break it by deleting mdadm.conf and rebuilding the initramfs to see
> if it still works.

On diskless systems, I have as part of the startup, an

	mdadm --examine --scan > /tmp/mdadm.scanned.conf
	mdadm -As --conf=/tmp/mdadm.scanned.conf

so technically its not needed a-priori here.  For systems with the root 
on a particular RAID you would want to assemble the RAID before the 
switch.  Most dracut based systems complain quite vociferously when you 
make mdadm go away, as they don't seem able to do what we've done above 
to figure out what they should assemble.

> I'm pretty sure it happens within the initramfs prior to the kernel
> even attempting to mount root. On systemd systems this could be
> better learned by passing systemd.log_level=debug
> systemd.log_target=console. The initramfs contains systemd, mdadm,
> mdadm.conf - and I'm pretty sure systemd activates that service, and
> then mdadm uses the mdadm.conf that's in the initramfs to assemble
> the array, and then systemd mounts it per the kernel command line
> which specifies root as an mduuid.

It would be nice if, as part of the startup, it did a scan, a comparison 
of the root device to whats available, and instead of timing out or 
panicing (both of which I've seen), that it  drops into a shell if the 
root raid device is either a) not there, or b) not ok to assemble.  The 
rd.shell dracut line sorta/kinda does this.  I am not sure what the 
systemd equivalent is.

Basically what I am saying is that the metadata for assembling the RAIDs 
is on the disks themselves, and the mdadm.conf (if it exists) should be 
used for confirmation/security/warning/error reporting purposes ... and 
not necessarily for actual assembly.


  reply	other threads:[~2014-03-07 20:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-07  2:13 Is mdadm.conf needed? Martin T
2014-03-07 19:00 ` Peter Grandi
2014-03-07 20:00 ` Chris Murphy
2014-03-07 20:13   ` Joe Landman [this message]
2014-03-08  3:07     ` Martin T

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=531A2883.1000100@gmail.com \
    --to=joe.landman@gmail.com \
    --cc=linux-raid@vger.kernel.org \
    /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 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.