Rescue Broken Kernel for Manjaro Jul 24th 2021 Words: 246

Background

I have a Manjaro installation with LUKS encrypted root. I don’t remember what exactly I have done wrong before I reboot my PC, but when it started again, it instantly rebooted to UEFI after I entered my volume password.

Locate the Problem

Hit Esc when the grub prompt for volume password to enter the grub rescue shell.

Use ls to check the partition layout in the computer, in my case, the Linux partition is (hd2,gpt6)

Decrypt and mount the LUKS: cryptomount (hd2,gpt6), after entering the password, an entry (crypto0) should be created.

Check the content of the volume: ls (crypto0)/boot: It seems the vmlinuz-* and linux*.img is missing, so I guess I deleted my linux kernel by mistake.

Solution

Make a Manjaro LiveCD and boot from it.

In the desktop environment, mount the broken Linux partition.

Now chroot to that partition: manjaro-chroot /run/media/what_ever_mount_point /bin/bash

After executing the above command, a bash shell will start. From now on, all the commands run in the shell will be executed as if it is on the system being rescued.

List available kernel: mhws-kernel -l

Reinstall the kernel: mhwd-kernel -i linux514

If the install command fails, try install using package manager: pacman -S linux514. The mkinitcpio and update-grub will be automatically invoked in this process.

Remember to install missing kernel modules(graphic card driver etc.) before restart: pacman -S linux514-nvidia

Reboot to the system and it should work now.