All of lore.kernel.org
 help / color / mirror / Atom feed
* RAID boot documentation
@ 2016-11-01 19:56 Doug Dumitru
  2016-11-02  6:29 ` NeilBrown
  0 siblings, 1 reply; 5+ messages in thread
From: Doug Dumitru @ 2016-11-01 19:56 UTC (permalink / raw)
  To: linux-raid

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.


Doug Dumitru

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

* Re: RAID boot documentation
  2016-11-01 19:56 RAID boot documentation Doug Dumitru
@ 2016-11-02  6:29 ` NeilBrown
  2016-11-02 16:51   ` Doug Dumitru
  0 siblings, 1 reply; 5+ messages in thread
From: NeilBrown @ 2016-11-02  6:29 UTC (permalink / raw)
  To: doug, linux-raid

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

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

* Re: RAID boot documentation
  2016-11-02  6:29 ` NeilBrown
@ 2016-11-02 16:51   ` Doug Dumitru
  2016-11-02 17:48     ` Wols Lists
  2016-11-04  3:51     ` NeilBrown
  0 siblings, 2 replies; 5+ messages in thread
From: Doug Dumitru @ 2016-11-02 16:51 UTC (permalink / raw)
  To: NeilBrown; +Cc: linux-raid

Neil,

Thank you very much.  If I chose to write up some documentation on
this, where/who might want it?  udev documentation in general seems
quite weak.

Doug


On Tue, Nov 1, 2016 at 11:29 PM, NeilBrown <neilb@suse.com> wrote:
> 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



-- 
Doug Dumitru
EasyCo LLC

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

* Re: RAID boot documentation
  2016-11-02 16:51   ` Doug Dumitru
@ 2016-11-02 17:48     ` Wols Lists
  2016-11-04  3:51     ` NeilBrown
  1 sibling, 0 replies; 5+ messages in thread
From: Wols Lists @ 2016-11-02 17:48 UTC (permalink / raw)
  To: doug, NeilBrown; +Cc: linux-raid

On 02/11/16 16:51, Doug Dumitru wrote:
> Neil,
> 
> Thank you very much.  If I chose to write up some documentation on
> this, where/who might want it?  udev documentation in general seems
> quite weak.
> 
I would be only too happy to see it on the raid wiki. Not quite sure
where I'd put it, but it's technical documentation, and I want that sort
of thing there.

Note, however, that Neil did make considerable mention of systemd and
udev. I run gentoo, which defaults to OpenRC, and my attempts to boot a
gentoo system with systemd have currently run foul of a non-starting
network ... So please make sure that it's written with the systemd/udev
assumptions very clearly spelt out ... :-) (I'm not the refusenik, it's
just that I can't get a systemd system working with my distro of choice :-)

Cheers,
Wol

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

* Re: RAID boot documentation
  2016-11-02 16:51   ` Doug Dumitru
  2016-11-02 17:48     ` Wols Lists
@ 2016-11-04  3:51     ` NeilBrown
  1 sibling, 0 replies; 5+ messages in thread
From: NeilBrown @ 2016-11-04  3:51 UTC (permalink / raw)
  To: doug; +Cc: linux-raid

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

On Thu, Nov 03 2016, Doug Dumitru wrote:

> Neil,
>
> Thank you very much.  If I chose to write up some documentation on
> this, where/who might want it?  udev documentation in general seems
> quite weak.

Maybe we should have an "md.systemd" man page.  I've been thinking the
same thing about "nfs.systemd"...

NeilBrown

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

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

end of thread, other threads:[~2016-11-04  3:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-01 19:56 RAID boot documentation Doug Dumitru
2016-11-02  6:29 ` NeilBrown
2016-11-02 16:51   ` Doug Dumitru
2016-11-02 17:48     ` Wols Lists
2016-11-04  3:51     ` NeilBrown

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.