mdadm_udev does not assemble degraded array during boot
Task Info (Flyspray) | |
---|---|
Opened By | Daan van Rossum (drrossum) |
Task ID | 57860 |
Type | Bug Report |
Project | Arch Linux |
Category | Arch Projects |
Version | None |
OS | All |
Opened | 2018-03-16 15:03:24 UTC |
Status | Assigned |
Assignee | Tobias Powalowski (tpowa) |
Assignee | Felix Yan (felixonmars) |
Details
Description: mkinitcpio's mdadm_udev hook uses mdadm upstream's udev rules to incrementally assemble raid arrays. 64-md-raid-assembly.rules uses systemd.timer to delay starting of partially assembled arrays to fix issues with slow array members (e.g. usb devices). But systemd.timer is not functional in initcpio. In case the array holds the root filesystem this has severe consequences:
- partially assembled array remain "inactive"
- the root FS is not available and does not get mounted
- boot process is interrupted with an emergency shell
From here, the following steps resume the boot process with a degraded array:
mdadm --incremental --run --scan
mount /dev/md0 /new_root
exit
This can be fixed using custom install and hook files for the mdadm_udev hook, see attached.
I think it should be mdadm_udev's default behavior to auto-assemble arrays (that are configured for auto-assembly in mdadm.conf) in degraded mode if necessary, instead of interrupting the boot process.
Additional info: mkinitcpio 24-2 mdadm 4.0-1
Steps to reproduce:
- Create a md raid-1 array
- move a system's root FS on the raid-1 array
- poweroff, remove one of the raid members
- poweron
- boot fails due to root FS not mounted