2

I had a kernel update and its essentially broken my machine.

I managed after several times to get it to boot up by selecting an older kernel, but now I can't fix the kernels that are installed.

When I run sudo update-initramfs -k all -u -v it hangs on:

Adding module /lib/modules/5.3.0-51-generic/kernel/drivers/md/raid10.ko

and then doesn't get any further. I'm not even sure which kernels work or not work, making me a bit worried about switching off my machine.

I am running Ubuntu 18.04 alongside a Windows 10 partition.

4 Answers 4

3

I had the same problem, sneakily enough the last thing output was loading raid10 but what was actually hanging was /sbin/mdadm --examine --scan --config=partitions in /usr/share/mdadm/mkconf. This was called by the mdadm hook for mkinitramfs so removing mdadm as Gord Rowland said should work. For me it hanged scanning dm devices which it seemed to do in decreasing order by number, this led me to suspect an external USB drive. The drive had opened LUKS on it but was not mounted. Previously having it attached had been fine. Closing it with cryptsetup also hanged so I disconnected it physically. After that running mdadm scans worked fine and updating initramfs also worked.

If you have this problem and need mdadm try running sudo /sbin/mdadm -vv --examine --scan --config=partitions and see if that hangs (the extra -vv is for more verbosity). If it does, check ls -l /dev/mapper/ if that points you to a drive that might be causing trouble. It should also be possible to configure which devices are scanned by mdadm and avoid any that cause problems but I did not try this.

1
  • This saved the day for me. My headless server was stuck at that same point. I edited the /usr/share/mdadm/mkconf script and commented out the final if/then/else block that calls /sbin/mdadm. Now sudo dpkg --configure -a succeeded. Thanks very much!
    – Jos
    Feb 5, 2021 at 10:03
1

I was also having this problem, and figured that RAID services weren't being used in my case, given that Ubuntu 20.04 is running in a KVM environment. (A quick look in Webmin showed me that no RAID was configured.)

On a hunch, I ran apt remove mdadm, and was then able to run update-initramfs manually.

I'm now able to use apt to install kernel packages again.

0

I'm having this exact problem, but with Ubuntu 20.04 on Power 8, 5.4.0-37-generic.

update-initramfs hanging indefinitely trying to load raid10.ko...

2
  • Please consider leaving this as a comment under the original question instead of as an answer.
    – guttermonk
    Jul 2, 2020 at 21:22
  • See my answer for how I managed to resolve it Jul 4, 2020 at 11:29
0

I managed to solve this but I can't remember the specifics.

I loaded up an Ubuntu LiveCD, mounted my Ubuntu partition and chrooted into it.

Then I removed all Kernels and installed kernel 5.0.0, after update-initramfs and rebooting I was able to get back into my Ubuntu install as normal.

Pretty much a scatter-gun approach but worked for me.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .