Soft RAID doesn't start with Linux 6.7.6 (but does with 5.15.148)
Hi,
I'm running Alpine Linux 3.19.1 on a server with 2 soft RAID 1 on 2 SSD:
-
/dev/md0
for/
-
/dev/md1
for/boot
It works with no issue on Linux 5.15.148 (compiled by myself). I took the same kernel base configuration and compiled Linux 6.7.6.
Since then, my machine doesn't boot and blocks on this:
Mounting root...
md/raid1:md0: active with 1 out of 2 mirrors
md0: detected capacity change from 0 to xxxx
When selecting the previous 5.15.148 kernel on boot, it works again like a charm. I have no idea why the RAID doesn't starts with Linux 6.7.6.
I made multiple tests and found a way to start the RAID with no issue by adding mdadm --assemble --scan
just before https://gitlab.alpinelinux.org/alpine/mkinitfs/-/blob/master/initramfs-init.in?ref_type=heads#L638.
It seems that nlplug-findfs
starts RAIDs using mdadm --incremental --run --quiet <devnode>
(see https://gitlab.alpinelinux.org/alpine/mkinitfs/-/blob/master/nlplug-findfs/nlplug-findfs.c?ref_type=heads#L484).
In my case it runs these 4 commands as expected:
mdadm --incremental --run --quiet /dev/sda1
mdadm --incremental --run --quiet /dev/sdb1
mdadm --incremental --run --quiet /dev/sda2
mdadm --incremental --run --quiet /dev/sdb2
nlplug-findfs
mounts each partition that have type linux_raid_member
.
Maybe we can simply let mdadm
mount them automatically with mdadm --assemble --scan
(which seems to read /proc/mdstat
and /etc/mdadm.conf
)?
Notes:
- The initramfs are exactly the same between the 2 kernels:
mkinitfs -n -o /boot/initramfs-5.15.148 5.15.148 mkinitfs -n -o /boot/initramfs-6.7.6 6.7.6
-
/etc/mdadm.conf
is well populated and exactly identical in both cases - There is no difference on RAID part between the configuration of 5.15.148 and 6.7.6
- There is no major difference between the configuration of 5.15.148 and 6.7.6
Best, Adrien