Skip to content

Instantly share code, notes, and snippets.

@sleeyax
Forked from ppartarr/reinstall-grub.sh
Last active February 20, 2023 09:59
Show Gist options
  • Save sleeyax/b651e5113061523a2af47f473840edeb to your computer and use it in GitHub Desktop.
Save sleeyax/b651e5113061523a2af47f473840edeb to your computer and use it in GitHub Desktop.
Reinstall grub after Windows updates (Arch & Windows dual boot)
#!/usr/bin/env bash
# list partitions
lsblk -f
# mount the root partition
mount /dev/nvme1n1p2 /mnt
# mount the boot partition
mount /dev/nvme1n1p1 /mnt/boot
# change root to root partition on /mnt
arch-chroot /mnt
# reinstall grub
grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB --removable
grub-mkconfig -o /boot/grub/grub.cfg
# exit partition, unmount and reboot
exit
umount -R /mnt
reboot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment