Restore kernel on Arch Linux
Published on: 2025-05-01
Yesterday I had the heart-attack-inducing experience of an unbootable
system after my usual pacman -Syu, which most of the time works out
just fine. Some of the time something breaks, but nothing as serious as
this: every trace of the Linux kernel had vanished from my /boot
drive, leaving my beloved Thinkpad with no brains to do anything but
drop back to the BIOS setup. After much fiddling and cursing I finally
managed to get the system up and running again, using a relatively
recent USB installation medium I had lying around after reinstallling
Arch on another laptop.
I am writing the steps down here, so that I will remember this in the future if something similar should happen again. And, who know, maybe it's useful for others as well…
- Insert the installation media before booting and hit F12 when starting up to get the boot menu.
- Connect the laptop to an ethernet cable for internet connection.
iwctlis available as well for wireless connection, but it's much quicker to just cable up. mkdir /mnt. The leading / is important!- Decrypt the encrypted main partition:
cryptsetup luksOpen /dev/nvme0n1p2 crypt-partition mount /dev/mapper/main_group-root /mnt. Note thatmain_group-rootis the name of the partition, notcrypt-partition!mount /dev/nvme0n1p1 /mnt/bootThebootdirectory probably exists already, as we're recovering an existing system, not installing a new one.arch-chroot /mntpacman -S linuxreboot
And that's it! After this my system was back up again, as if nothing had ever happened.