Skip to content

Instantly share code, notes, and snippets.

@jpcaparas
Last active May 11, 2019 10:15
Show Gist options
  • Save jpcaparas/cc3847d26fb72041a3065b864f72c6ff to your computer and use it in GitHub Desktop.
Save jpcaparas/cc3847d26fb72041a3065b864f72c6ff to your computer and use it in GitHub Desktop.
Chain load Windows 10 bootloader with Grub
#!/usr/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
# location /etc/grub.d/40_custom
# when done, run sudo grub2-mkconfig -o /boot/grub2/grub.cfg && sudo grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg
menuentry "Windows 10" --class windows --class os {
insmod part_gpt
insmod fat
set root='hd0,gpt2' # gpt2 is equivalent /dev/sda2
search --no-floppy --set=root --fs-uuid $uuid-of-efi-partition # change the var here
chainloader /EFI/Microsoft/bootmgfw.efi
}
bootrec.exe /Rebuildbcd
bootrec.exe /Fixmbr
bootrec.exe /Fixboot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment