Skip to content

Instantly share code, notes, and snippets.

@ppartarr
Created March 5, 2021 08:24
Show Gist options
  • Save ppartarr/0b4de0649e3d625d324a063248812f68 to your computer and use it in GitHub Desktop.
Save ppartarr/0b4de0649e3d625d324a063248812f68 to your computer and use it in GitHub Desktop.
Reinstall grub after Windows updates (Arch & Windows dual boot)
#!/usr/bin/env bash
# mount the boot partition
mount /dev/nvme0n1p9 /mnt
mount /dev/nvme0n1p7 /mnt/boot
# change root to /mnt partition
arch-chroot /mnt
# reinstall grub
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=grub
grub-mkconfig -o /boot/grub/grub.cfg
os-prober
# 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