grub2 for Windows 10 after installing Rocky 8.5

So, I came into a hiccup, and the amount of time it took to diagnose and resolve seemed like it should be something I documented.

In doing the initial installation of Rocky 8.5 on the computer that my kids sometimes use that runs Windows 10 I wasn’t really given the opportunity to configure a multiboot. Instead, the system happily booted Rocky 8.5 and nothing else.

Additionally, running os-prober didn’t really find another operating system, so I had to do some manual work.

To even get to this point I had to free up 30gb of data on the host hard drive to make the Rocky 8.5 installation. That partition ended up being the 3rd of 4 partitions. After the resize was done the installation was started, set up, and finalized.

The fix to this seemed to be fairly easy. I had to create /etc/grub.d/50_windows.conf with the following contents (from stackexchange):

#!/bin/sh
cat <<EOF
menuentry "Windows 10" {
  insmod chain
  insmod ntfs
  set root=(hd0,1)
  chainloader +1
  boot
}
EOF

Second, I had to generate the grub config file (from stackexchange):

sudo grub-mkconfig -o /boot/grub/grub.cfg

Once I rebooted I had my new menu prompt.

The main difficulty in this was finding information that was not grub and was specifically grub2, which is why I felt the need to document this.

Leave a Reply