-
Notifications
You must be signed in to change notification settings - Fork 44
dracut: add module to assemble root raid array #130
Conversation
1886313
to
170fda6
Compare
# only arrays that might contain the root filesystem. Arrays that contain | ||
# the root filesystem should have a name suffixed with ROOT so we can find them. | ||
|
||
# These rules compliment the rules in 64-md-raid-assembly, only adding the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: complement
|
||
# Don't process any events if anaconda is running as anaconda brings up | ||
# raid devices manually | ||
ENV{ANACONDA}=="?*", GOTO="md_inc_end" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can skip testing for the Fedora/RHEL installer.
However, this does point to a problem: we don't want to assemble RAID devices during first boot if Ignition is going to clobber the partitions. We should disable autorun if coreos.first_boot
is set. In that case the Ignition config must mention any RAID needed for the root filesystem or we will fail to boot, but it seems plausible that we wouldn't support reusing an existing root RAID while running Ignition for unrelated reasons.
We'll also want a kola test for this.
@@ -0,0 +1,45 @@ | |||
# do not edit this file, it will be overwritten on update |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The file is initramfs-only, so this can be dropped.
|
||
LABEL="md_inc" | ||
|
||
# Only auto-assembly drives in arrays with a name ending with ROOT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assemble
Also, update name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, update name.
What do you mean by this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not ROOT anymore.
ENV{ID_FS_TYPE}=="isw_raid_member", GOTO="md_inc" | ||
GOTO="md_inc_end" | ||
|
||
LABEL="md_inc" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's prefix label names so there's no possibility of collision.
|
||
# Only auto-assembly drives in arrays with a name ending with ROOT | ||
IMPORT{program}="/sbin/mdadm --examine --export $devnode" | ||
ENV{MD_NAME}!="*-hasroot", GOTO="md_inc_end" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please update commit message to match.
|
||
# Since dracut 24, drives are not auto-assembled. We need to auto-assemble | ||
# only arrays that might contain the root filesystem. Arrays that contain | ||
# the root filesystem should have a name suffixed with ROOT so we can find them. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update name.
# do not edit this file, it will be overwritten on update | ||
|
||
# Since dracut 24, drives are not auto-assembled. We need to auto-assemble | ||
# only arrays that might contain the root filesystem. Arrays that contain |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please explain in the comment why we want only those arrays.
ENV{MD_NAME}!="*-hasroot", GOTO="md_inc_end" | ||
|
||
# remember you can limit what gets auto/incrementally assembled by | ||
# mdadm.conf(5)'s 'AUTO' and selectively whitelist using 'ARRAY' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment not relevant to the initramfs; drop.
9ce482e
to
755ec44
Compare
https://github.com/coreos/ignition/blob/master/internal/exec/stages/disks/disks.go#L203 Seems to refer to a related issue. Do you think it's referring to the fact that raid arrays are started before ignition is run and thus their components are unvailable or something else? If it is, we can get rid of that fixme as well. |
I think it's referring to the initramfs autorunning a different array with the same name as the one we're creating. We can probably drop the comment, but maybe first we should test creating a new array with the same name as an existing and non-overlapping one. |
# Ignition may want to clobber partitions used in a raid array, so | ||
# skip assembling them in that case. | ||
IMPORT{cmdline}="coreos.first_boot" | ||
ENV{coreos.first_boot}=="1", GOTO="root_md_inc_end" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
coreos.first_boot
can have truthy values other than 1. detected
will be typical, but the full set of rules are here.
IMPORT{cmdline}="nodmraid" | ||
|
||
ENV{nodmraid}=="?*", GOTO="root_md_inc_end" | ||
ENV{ID_FS_TYPE}=="ddf_raid_member", GOTO="root_md_inc" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On further reflection, I think the DDF/IMSM stuff can all be dropped. DDF doesn't appear to have device names; IMSM won't run in qemu but I don't think it does either; and we probably don't want to support root-on-FakeRAID anyway.
SUBSYSTEM!="block", GOTO="root_md_inc_end" | ||
|
||
# Ignition may want to clobber partitions used in a raid array, so | ||
# skip assembling them in that case. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that case
being that Ignition is going to run.
755ec44
to
8d183b8
Compare
Updated to handle |
Add a udev rule to auto-assemble raid devices belonging to an array ending in -hasroot. This allows the root filesystem to be found when it's on a raid array. Also don't auto-assemble when running Ignition since Ignition may want to modify a partition in a raid array.
8d183b8
to
9588c3b
Compare
Add a udev rule to auto-assemble raid devices belonging to an array
ending in ROOT. This allows the root filesystem to be found when it's on
a raid array.