Repository navigation
mdraid: assemble md arrays only with mdraid=true - #186
Merged
Merged
Conversation
FOS assembles arrays in S99fog only when the kernel command line carries mdraid=true. But Buildroot installs mdadm's udev rules whenever eudev is the device manager. 64-md-raid-assembly.rules runs "mdadm --incremental" on every RAID member at coldplug, so arrays assembled without the flag. The array holds its member partitions, and capture stops at "Reading Partition Tables...Failed / Could not find partitions" (forums 18202). The overlay now masks that rule with a copy gated on mdraid=true. S99fog also stops any array when the flag is off, which covers the kernel's own v0.90 autodetect. With mdraid=true nothing changes. Verified in QEMU with the built x64 init and a RAID1 on sda1+sda2: old init, no flag: md0 active, holds sda1 and sda2 (the bug) new init, no flag: no array, no holders new init, mdraid=true: md0 active, as before tests/checks/mdraid-gate.sh guards the mask, the gate order, the S99fog branch, and with -b that the copy still matches the installed rule. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Without
mdraid=true, FOS still assembles md arrays at boot. The array holds its member partitions, and capture fails at "Reading Partition Tables...Failed / Could not find partitions". Forums topic 18202 showsmd126/md127onnvme0n1p2/p3with nomdraidon the command line.Cause
Buildroot installs mdadm's udev rules when eudev is the device manager.
64-md-raid-assembly.rulesrunsmdadm --incrementalon every RAID member at coldplug. S99fog'smdraid == truegate never applied to udev.Fix
etc/udev/rules.d/64-md-raid-assembly.rulesmasks mdadm's/librule. It is a copy of mdadm 4.3's rule with a gate onmdraid=truefrom the kernel command line.mdadm --stop --scanwhen the flag is off. This releases arrays from the kernel's own v0.90 autodetect.mdraid=true, behavior does not change.Verification
QEMU, built x64 init, RAID1 (md 1.2) on sda1+sda2, udev coldplug through the real
S10udevd:md0active, holds sda1 and sda2 (the bug)mdraid=truemd0active, as beforetests/checks/mdraid-gate.sh -bpasses. I made it fail on each defect: gate removed, copy drifted from upstream, S99fog stop removed, mask file removed.Not tested: a full capture on real NVMe, and the S99fog stop path (needs a v0.90 array on a type-fd partition).
🤖 Generated with Claude Code