Skip to content

Instantly share code, notes, and snippets.

@bsantraigi
Created July 28, 2024 05:19
Show Gist options
  • Save bsantraigi/9bc6c97cec676c6543a8d0c36a312968 to your computer and use it in GitHub Desktop.
Save bsantraigi/9bc6c97cec676c6543a8d0c36a312968 to your computer and use it in GitHub Desktop.
Recreating /boot and /boot/efi partition of a broken installation

Recreating or fixing the /boot and /boot/efi partition of a broken installation

  • Situations
    • Deleted /boot partition by mistake or intentionally.
    • /boot partition got corrupted
    • Failed update
  • Commands are for an Arch-linux installation, so you might need to find the equivalent for other distros.

After chroot-ing into the installation through a live iso. (See my other gist)

pacman -S grub

# mkdir /boot/efi [not always required]
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=GRUB
grub-mkconfig -o /boot/grub/grub.cfg

pacman -S linux linux-lts
mkinitcpio -p linux
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment