Skip to content

Instantly share code, notes, and snippets.

@Pristavkin
Last active February 10, 2020 19:16
Show Gist options
  • Save Pristavkin/2ae751c1d48efe594415f61b78b84bfa to your computer and use it in GitHub Desktop.
Save Pristavkin/2ae751c1d48efe594415f61b78b84bfa to your computer and use it in GitHub Desktop.
RHEL/CentOS GRUB dualboot Winows config
#!/bin/sh
# 1. Place this file to /etc/grub.d/05_Windows
# 2. Update Windows patrtition setting. In this example Winodws will be booted from hd0,1 - sda2 partition ("hd0" is sda, and ",1" is second partition on disk)
# 3. Add "GRUB_DEFAULT=saved" and "GRUB_SAVEDEFAULT=true" lines to /etc/default/grub for save last booted OS
# 4. Run "chmod +x /etc/grub.d/41_Windows && grub2-mkconfig --output=/boot/grub2/grub.cfg" after all modifications for make new config file
exec tail -n 5 $0
menuentry "Windows 10" {
savedefault
set root=(hd0,1)
chainloader +1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment