-
-
Notifications
You must be signed in to change notification settings - Fork 13.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sw-raid: make mdmon start from initrd #13447
Conversation
By analyzing the blame information on this pull request, we identified @edolstra, @wkennington and @nbp to be potential reviewers |
Sounds good to have in release. cc @edolstra as the original author of |
Hm, I wonder how is it possible that the swraid tests do succeed most of the time: http://hydra.nixos.org/job/nixos/release-15.09/nixos.tests.installer.swraid.x86_64-linux Note btw that the initrd kills all processes except those whose argv[0] starts with |
From the description of |
It seems that |
Yes, As for the other services, |
From these descriptions it seems to me that we can add
|
Could we use the upstream systemd units? Looks like they're not currently installed by the mdadm package. |
I think not for |
I added |
Your patch is about |
Yes, sorry, I mixed them up for a second. Also theres an oddity I noticed. When I boot up I have in I have two mdmon processes: after five or so minutes the one under init.scope stops, and I'm left with just the one under system.slice. I don't know what to make of it - is this expected behavior or not? Maybe it's connected with not having systemd in initrd? |
If I understand correctly, it works as follows:
I don't know how that |
I think we can merge this -- problem with a leftover |
I'll merge this in a few days unless there are any issues with the PR. @domenkozar do you think this is worthy of merging into new 16.03 branch? tl;dr: this should fix (at least make usable when they are not degraded) RAID arrays with non-native metadata, for example Intel fake RAID arrays (I don't know of any others). |
Sure |
@kklas Could you squash this into one commit? |
Yes, sorry, but I'm not remotely near a keyboard. I return eight of march,
I can only do it then.
|
Also add required systemd services for starting/stopping mdmon.
Merged with a small change ( |
Also add required systemd services for starting/stopping mdmon. (cherry picked from commit aac666e) See #13447 (comment) for cherry-pick discussion.
Also add required systemd services for starting/stopping mdmon. Closes NixOS#13447. abbradar: fixed `mdadmShutdown` service name according to de facto conventions.
Also add required systemd services for starting/stopping mdmon. (cherry picked from commit aac666e) See NixOS#13447 (comment) for cherry-pick discussion.
Things done:
nix.useChroot
.Extra
Fixes #13058
After investigating my problem #13058 I found out partitions couldn't be mounted as non read-only because mdmon wasn't started in initrd because the binary wasn't included, so I added it.
The other problem was raids syncing after every boot. This happens because arrays aren't clean on shutdown. I fixed this by adding systemd services for starting/stopping mdmon to ensure proper shutdown. The mdmon@.service is actullay called for by udev rules in https://github.com/nixos/nixpkgs/blob/0e32206a8610bf76bf5e82af4f6dd510a83a3d1d/nixos/modules/tasks/swraid.nix#L12 but is missing.
Referencing this:
https://git.centos.org/blob/rpms!mdadm.git/8c89314bd54c3fdc59cad75f6cc4505a30a8e8fb/SOURCES!mdadm-3.2.6-systemd-various-fixes-for-boot-with-container-arrays.patch
https://github.com/neilbrown/mdadm/blob/master/systemd/mdmon@.service
https://github.com/neilbrown/mdadm/blob/master/systemd/mdadm.shutdown