Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 863767 - sys-kernel/genkernel-4.2.6-r6: initramfs can't mount rootfs if mdadm raid is in degraded state
Summary: sys-kernel/genkernel-4.2.6-r6: initramfs can't mount rootfs if mdadm raid is ...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: genkernel (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Genkernel Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-08-05 09:21 UTC by Grigoriy Puzankin
Modified: 2022-08-05 09:21 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Grigoriy Puzankin 2022-08-05 09:21:36 UTC
Genkernel generates an initramfs. It lacks the functionality to run degraded mdadm arrays.

Reproducible: Always

Steps to Reproduce:
1. Put mdadm raid1 in degraded state (by removing 1 of 2 drives).
2. Then reboot the system.
3. Initramfs reports that it can't find rootfs, prompts user to type "shell" for a shell, "q" to skip.
Actual Results:  
Initramfs reports that it can't find rootfs, prompts user to type "shell" for a shell, "q" to skip.

Expected Results:  
Degraded raid1 should be assembled with 1 of 2 drives. Normal boot order.

Looks like initramfs assembles mdadm arrays using udev rules with --incremental command to mdadm. Once it finds a block device like /dev/sd* it tries to add disk/partition to mdadm array. Array becomes active after adding all disks/partitions to it.

In my case raid1 is degraded, udev adds only one partition to it and leaves the array in inactive state. There're no other scripts or actions that could run a degraded array.

In order to continue booting I have to enter recovery shell (prompted by initramfs). Then execute:
mdadm --stop /dev/md3
mdadm --assemble --run /dev/md3

Another workaround is to patch genkernel's initrd.scripts to re-assemble all arrays according to mdadm.conf.

This is critical for servers, since the remote access will be lost upon reboot.