The issue
Recently, my laptop (Lenovo ThinkPad P14s Gen 1, AMD) started to reboot randomly; and sometimes it didnt even wake up from sleep.
So i tried to change kernel. I removed the active kernel and installed a new one (huge mistake, now i know it)
But after that, manjaro wasnt booting anymore.
What i already tried
I booted on live usb and did the following :
pacman-mirrors -f5
pacman -Syu
then ctrl+alt+f2
then logged in
sudo mhwd-kernel -linux54
all downloaded correctly but at the end, an error occurred :
usr/bin/grub-probe: error: failed to get cannonical path of ‘overlay’.
error: command failed to execute correctly
Glad you learnt something, at least then. Anyway, you should never try and remove your current kernel. Also, It’s recommended you keep at least 2 kernels installed, of which one should be an LTS version. That way you can use a different one to test, or work with or use to recover your system if something goes wrong with your current one.
What you tried looks good, except that you haven’t chrooted into your install so all the commands are excuted for the Live ISO and not your installed system. Tr6y the following:
Boot into the live ISO environment and open a terminal.
Enter a chroot environment of your system:
manjaro-chroot -a
Depending on the age of the Live ISO, there might be an error if you are asked which environment to enter. If thee one you selected doesn’t work, try the same one minus 1 again.
Once successfully in the chroot environment, update the mirrors again:
pacman-mirrors -f5
Once that is successful, you can go ahead and install a new kernel.
sudo mhwd-kernel --install linux54
That will install the 5.4 LTS kernel. While you’re at it, install 5.10 LTS as well:
sudo mhwd-kernel --install linux510
When it’s done, you can exit the chroot environment.
exit
And, at least in theory, you should be able to reboot safely using the new kernel.
The second and third command are only useful to install headers and extramodules for all other potentially installed kernels, just in case you need it next time.