Manjaro not booting after trying to fix error /boot/vmlinuz

about a week ago i ran the command sudo pacman -Syu to update my system, however i ctrl-C since it took too long (or i turned the computer off, can’t remember which one), later i tried turning on my laptop and it gave the error file /boot/vmlinuz not found, i googled the error and found a way to fix it, i followed the steps:
1.get an usb with manjaro on it.
2.open terminal after booting using the usb and run the following commands

sudo su -
manjaro-chroot -a
pacman-mirrors -f 5 && pacman -Syyu
update-grub
exit

after that i turned the laptop off, removed the usb, turned the laptop on and this time it didnt load manjaro at all, it simply loaded memtest, which was odd, i googled some more and found that u can press ESC key to show the grub boot menu, i did that and all the menu showed was memtest, no manjaro(manjaro was an option before running the commands i ran)

do note that when i ran the command manjaro-chroot -a the following errors were shown in terminal

grub-probe: error: cannot find a GRUB drive for /dev/sdb1.  Check your device.map.
grub-probe: error: cannot find a GRUB drive for /dev/sdb1.  Check your device.map.

How can i fix this? is there any additional information i need to provide ? if so please tell me can i get access to such info. Thank you.

sudo su -
manjaro-chroot -a
pacman-mirrors -f 5 && pacman -Syyu
mkinitcpio -P # <-- this creates vmlinuz
update-grub
exit

the following errors appeared after i ran the command

mkinitcpio -P
==> Building image from preset: /etc/mkinitcpio.d/linux515.preset: 'default'
  -> -k /boot/vmlinuz-5.15-x86_64 -c /etc/mkinitcpio.conf -g /boot/initramfs-5.15-x86_64.img
==> ERROR: specified kernel image does not exist: `/boot/vmlinuz-5.15-x86_64'
==> Building image from preset: /etc/mkinitcpio.d/linux515.preset: 'fallback'
  -> -k /boot/vmlinuz-5.15-x86_64 -c /etc/mkinitcpio.conf -g /boot/initramfs-5.15-x86_64-fallback.img -S autodetect
==> ERROR: specified kernel image does not exist: `/boot/vmlinuz-5.15-x86_64'

i forgot to mention but i did run the following command before too

rm -f /var/lib/pacman/db.lck

specifically i ran it after running

sudo su -
manjaro-chroot -a

You need to install kernels you had before again. That’s all.

see this

No need for mkinitcpio and update-grub even, pacman will do it via pacman hooks anyway.

Thanks that worked.

As well as you don’t need sudo to chroot in the live USB, and you definitely don’t use sudo in the chroot terminal as you’re already root.

I haven’t mentioned anything about sudo and chroot though. :slight_smile: (I usually leave sudo out anyway - people can figure it out by themselves.)

I didn’t write that. You replied to a post, correcting it, and I replied to yours and wrote “as well as blabla…” adding to the correction. This works but is not correct:

sudo manjaro-chroot -a
sudo update-grub

I see that often copy/pasted, and despite telling it every time, people continue the same copy/paste of the same erroneous commands.

Roger. Although I’m not sure about manjaro-chroot off the top of my head.

EDIT: Ok, spun VM. You are correct. I guess things just work better with sudo and -Syyyyu.

I’m sure, you don’t need sudo in the live USB to chroot (unless it changed recently).

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.