public inbox for linux-raid@vger.kernel.org
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.com>
To: doug@easyco.com, linux-raid <linux-raid@vger.kernel.org>
Subject: Re: RAID boot documentation
Date: Wed, 02 Nov 2016 17:29:04 +1100	[thread overview]
Message-ID: <87funaqtsf.fsf@notabene.neil.brown.name> (raw)
In-Reply-To: <CAFx4rwS4xWDcRbWpnq__zTw5FqXA1SUNW1bJgWpxWotJiRKzdA@mail.gmail.com>

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

On Wed, Nov 02 2016, Doug Dumitru wrote:

> Does anyone have any documentation on when a non-root RAID device
> mounts and how this is triggered?
>
> I have dug around looking for calls to 'mdadm' and or references to
> mdadm.conf to read the array details, but am not finding the obvious
> things.  Then again, the new boot services still confuses me.
>

This depends on what the distro you are using chooses to implement.

If your distro that uses systemd and uses the udev rules and unit files
that are distrubuted with upstream mdadm, then:

When a device is discovered that contains raid metadata, udev will run
  mdadm --incremental --export /dev/whatever
(or similar)

See /usr/lib/udev/rules.d/64-md-raid-assembly.rules for details.

Once this has happened for all devices in an array, the array will be
started by mdadm.

If mdadm notices that the array *could* be started if needed, but that
it still expects more devices to appear, it reports
    MD_STARTED=*unsafe*
and the udev rules file uses this to trigger a message to systemd to
start "mdadm-last-resort@devicename.timer"
This sets a timer.  When the timer fires, the array is started even
though some devices might be missing.
If the array gets started before that (because the missing devices
appeared) the timer is canceled.

When an md array (or any other device) appear, some other udev handling,
possibly involving udisks, might cause the filesystem to be mounted.
That is completely outside of the control of mdadm.  mdadm just
assembles the device.

Hope that helps.

NeilBrown

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 800 bytes --]

  reply	other threads:[~2016-11-02  6:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-01 19:56 RAID boot documentation Doug Dumitru
2016-11-02  6:29 ` NeilBrown [this message]
2016-11-02 16:51   ` Doug Dumitru
2016-11-02 17:48     ` Wols Lists
2016-11-04  3:51     ` NeilBrown

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=87funaqtsf.fsf@notabene.neil.brown.name \
    --to=neilb@suse.com \
    --cc=doug@easyco.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox