
Last Friday, just before closing my laptop and enjoying my weekend I managed to break my EndeavourOS VM by accidentally shutting it down while it was still updating the kernel in another terminal session. It no longer booted as a result.
To fix it, I found a helpful blog post by Edmund Goodman which proved useful, albeit slightly different from my environment. Goodman was using GRUB and Ext4, whereas my environment is using Systemd-boot and Btrfs.
The repair process proved very similar but I decided to briefly document it just in case, if only to help a fellow Nerd in need:
-
Boot with an EndeavourOS live image.
-
Identify the boot and root partitions:
root # lsblk -f
For me it was:
-
/dev/sda1
(EFI boot); -
/dev/sda2
(encrypted root).
-
-
Decrypt the encrypted root partition:
root # cryptsetup open /dev/sda2 luks_root
-
Mount the decrypted root partition, and mount the EFI boot partition inside:
root # mount /dev/mapper/luks_root -o subvol=/@ /mnt root # mount /dev/sda1 /mnt/efi
-
Chroot into the unbootable environment:
root # arch-chroot /mnt
-
Repair the environment:
root (chroot) # rm /var/lib/pacman/db.lck root (chroot) # pacman -Syu root (chroot) # pacman -Syu linux linux-headers root (chroot) # reinstall-kernels
NoteReplace the above kernel and kernel headers with the ones you yourself use (.e.g. linux-lts
, andlinux-lts-headers
). When in doubt, try the above default ones. -
Cleaning up:
root (chroot) # exit root # umount /mnt/boot/ root # umount /mnt/tmp/ root # cryptsetup close luks_root
Then reboot, and remove the live image. This should help booting the system again.