How to add Windows to GRUB

I have my encrypted Archlinux installed on my SSD. Now I have one HDD with Windows installed. But in my GRUB just Archlinux is shown (no Wonder, because I just installed Windows on the other HDD, GRUB doesn’t know of that by now.).

My Question is, how do I properly add my Windows-HDD to GRUB, so that I can choose which to boot when starting?

I am a little bit afraid of destroying my GRUB so I can’t boot my encrypted Archlinux anymore.

Thanks!

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

Save a backup of your all your grub configuration files.

There are two methods I have used in the past:

1) Install ntfs-3g (which should allow your installation to see the windows partition automatically) using your package manager. It was available in the EPEL repo for me, but you’ll have to find a different repo for it on Arch.

Then sudo grub2-mkconfig. This worked for me while trying to get my centos7 dual boot to work with windows.

2) Alternately, you’d be best off adding a custom entry by adding a file to /etc/grub.d/

For example, on my current system which is a Centos7 + Windows 10 dual boot:

$ sudo cat /etc/grub.d/40_custom
#!/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.
menuentry "Windows 10" {
   set root='(hd0,1)'
   chainloader +1
}

Where the menuentry parameter is the name that will appear in the grub menu. The (hd0,1) will change depending on what hard disk and what partition you have windows on.


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x