Skip to main content
Topic: [SOLVED] Kernel panic and can't run mkinitcpio (Read 4139 times) previous topic - next topic
0 Members and 4 Guests are viewing this topic.

[SOLVED] Kernel panic and can't run mkinitcpio

I am sorry if I am being dumb and missing something basic, but I have been trying on and off to get my system fixed for a week and don't seem to be making much progress.

When I try to boot I get a kernel panic with the message that no working init can be found.  When I chroot into the installation I am unable to run mkinitcpio because of the following error message:
Code: [Select]
==> WARNING: Failed to enable color. Check your TERM environment variable
==> ERROR: '/lib/modules/4.9.41-1-lts' is not a valid kernel module directory
now I have confirmed that this directory does not actually exist, but I do not know how to stop this occurring or why it is occurring in the first place.

I would appreciate any help in fixing this and will try to provide extra information if people ask for it.

Re: Kernel panic and can't run mkinitcpio

Reply #1
What system are you chrooting from and what system is handling grub when you boot?

Similar thing happened to me last week as my system seem to have been left half updated.

If you boot from the artix.iso use artools-chroot
Run
Code: [Select]
pacman -Syyu
Code: [Select]
mkinitcpio -P -k linux-lts
(or whatever kernel you use)
Code: [Select]
update-grub
 

If you are using another system''s grub cut the menuentry from <chroot-artix>-/boot/grub/grub.cfg and paste it in the other system's grub.cfg
If you want artix to handle grub and your hd is sda
Code: [Select]
grub-install /dev/sda
  (for bios boot, for uefi is a little different ... check the Arch-wiki for specifics)


Re: Kernel panic and can't run mkinitcpio

Reply #2
I am sorry if I am being dumb and missing something basic, but I have been trying on and off to get my system fixed for a week and don't seem to be making much progress.

When I try to boot I get a kernel panic with the message that no working init can be found.  When I chroot into the installation I am unable to run mkinitcpio because of the following error message:
Code: [Select]
==> WARNING: Failed to enable color. Check your TERM environment variable
==> ERROR: '/lib/modules/4.9.41-1-lts' is not a valid kernel module directory
now I have confirmed that this directory does not actually exist, but I do not know how to stop this occurring or why it is occurring in the first place.
I would appreciate any help in fixing this and will try to provide extra information if people ask for it.
At least you can chroot. Re-install linux-lts and linux-lts-headers before running mkinitcpio -p linux-lts. If you still can't boot, do a full system update (with pacman -Syu) inside the chroot, having enabled the [system-testing] repo. Make sure you have the new mirrorlist in place.



 

Re: Kernel panic and can't run mkinitcpio

Reply #3
Thanks for the tips guys, I hadn't tried using specific parameters on mkinicpio, so I'll try that first.

I am using the Artix i3 live image for this, the grub is from the Artix system (though it was originally Manjaro if that is relevant) and I did a system update before trying to fix.

Is there an advantage in using artools-chroot over standard chroot and if so what parameters do I need to use?  "-a"?  I tried bringing up a man page for it before and didn't get anything and there doesn't seem to be instructions on the GitHub either. 

I'm at work right now so trying to clear things up in case there is something extra I should know before trying this.


Re: Kernel panic and can't run mkinitcpio

Reply #5
Re-install linux-lts and linux-lts-headers before running mkinitcpio -p linux-lts.

I did this and am booting again, thanks :D  Can't believe I spent ages playing around with trying different glibc versions when this was the cause.