Grub Add Windows Boot Entry: A Step-by-Step Guide
If you’re dual-booting Windows and Linux, you may have found that the GRUB bootloader doesn’t always list Windows as an option when you start your computer. This can be a problem if you want to quickly and easily switch between operating systems.
Fortunately, it’s relatively easy to add a Windows boot entry to GRUB. In this guide, I’ll show you how to do just that. I’ll also provide some tips on troubleshooting common problems.
So, if you’re ready to learn how to add a Windows boot entry to GRUB, read on!
Column 1 | Column 2 | Column 3 |
---|---|---|
Title | Description | Link |
How to add a Windows boot entry to GRUB | This guide will show you how to add a Windows boot entry to GRUB, the bootloader used by most Linux distributions. | How to Add a Windows Boot Entry to GRUB |
Troubleshooting GRUB boot problems | This guide will help you troubleshoot GRUB boot problems, such as when GRUB is not showing up, or when you are unable to boot into Windows from GRUB. | Troubleshooting GRUB Boot Problems |
What is GRUB and why do you need it?
GRUB, which stands for GRand Unified Bootloader, is a bootloader that is used to load the operating system (OS) on a computer. It is a very versatile bootloader that can be used to boot multiple operating systems from the same computer, as well as to boot from a USB drive or CD-ROM.
GRUB is installed on the master boot record (MBR) of the hard drive, and it is the first thing that is loaded when the computer starts up. GRUB then scans the hard drive for operating systems and presents a menu from which the user can select which OS to boot.
GRUB is a very important part of the boot process, and it is essential for ensuring that the correct operating system is loaded. If GRUB is not working properly, it can prevent the computer from booting up correctly.
Adding a Windows boot entry to GRUB is a relatively simple process, but there are a few things that you need to know in order to do it correctly.
First, you need to know the location of the Windows installation files. This is usually located in the `/boot/efi` directory on the hard drive.
Second, you need to know the name of the Windows boot loader. This is usually called `bootmgfw.efi`.
Once you have this information, you can follow these steps to add a Windows boot entry to GRUB:
1. Open the GRUB configuration file. This file is located in the `/etc/grub.d/` directory.
2. Find the section that starts with `menuentry “Windows”`.
3. Add the following lines to the end of the section:
set root=(hd0,gpt2)
chainloader /EFI/Microsoft/Boot/bootmgfw.efi
4. Save the GRUB configuration file.
5. Regenerate the GRUB bootloader. This can be done by running the following command:
sudo grub-mkconfig -o /boot/grub/grub.cfg
6. Reboot the computer.
Once the computer has rebooted, you should see the Windows boot entry in the GRUB menu. You can select this entry to boot into Windows.
GRUB is a powerful and versatile bootloader that can be used to boot multiple operating systems from the same computer. Adding a Windows boot entry to GRUB is a relatively simple process, and it can be done by following the steps in this guide.
Troubleshooting common problems
Here are some common problems that you may encounter when trying to add a Windows boot entry to GRUB:
- The Windows boot entry is not showing up in the GRUB menu. This is usually caused by a missing or incorrect configuration file. To fix this, you can try reinstalling GRUB or manually editing the GRUB configuration file.
- The Windows boot entry is not working. This can be caused by a number of factors, such as a corrupt Windows installation or a missing or incorrect driver. To fix this, you can try reinstalling Windows, updating your drivers, or using a third-party bootloader.
- The Windows boot entry is taking too long to load. This can be caused by a number of factors, such as a slow hard drive or a large Windows installation. To fix this, you can try defragmenting your hard drive or reducing the size of your Windows installation.
If you are having trouble troubleshooting these problems, you can try asking for help on a Linux forum or mailing list.
Tips and tricks for using GRUB
Here are some tips and tricks for using GRUB:
- To add a new boot entry, you can use the `grub-install` command. This command will install GRUB to the specified device and create a new boot entry for the specified operating system.
- To edit a boot entry, you can use the `grub-editenv` command. This command will open the GRUB configuration file in a text editor, where you can make changes to the boot entry.
- To delete a boot entry, you can use the `grub-remove-menuentry` command. This command will delete the specified boot entry from the GRUB menu.
- To change the order of the boot entries, you can use the `grub-set-default` command. This command will set the specified boot entry as the default boot entry.
- To change the timeout for the GRUB menu, you can use the `grub-set-timeout` command. This command will set the number of seconds that the GRUB menu will be displayed before automatically booting the default boot entry.
For more information on using GRUB, you can refer to the GRUB documentation.
In this article, we have shown you how to add a Windows boot entry to GRUB. We have also provided some tips and tricks for troubleshooting common problems and using GRUB. If you have any other questions about GRUB, please feel free to ask in the comments below.
Q: How do I add a Windows boot entry to GRUB?
A: To add a Windows boot entry to GRUB, follow these steps:
1. Boot into the GRUB bootloader.
2. Press the e key to edit the current boot configuration.
3. Find the line that starts with `menuentry` and contains the name of your Windows installation.
4. Add the following options to the end of the line:
options=quiet splash
5. Save the changes and exit the GRUB bootloader.
Your Windows installation should now be listed as a boot option in GRUB.
Q: What if I get an error when I try to add a Windows boot entry to GRUB?
A: There are a few possible reasons why you might get an error when trying to add a Windows boot entry to GRUB. Here are some common troubleshooting tips:
- Make sure that you are using the correct version of GRUB for your operating system.
- Make sure that you have the correct drivers for your Windows installation.
- Make sure that you have added the correct options to the `menuentry` line.
- Try booting into Windows from a recovery disk or a USB drive. This can help you identify any problems with your Windows installation.
If you are still having problems, you can try asking for help on a forum or mailing list dedicated to GRUB.
Q: How do I change the order of the boot entries in GRUB?
A: To change the order of the boot entries in GRUB, follow these steps:
1. Boot into the GRUB bootloader.
2. Press the e key to edit the current boot configuration.
3. Find the line that starts with `menuentry` and contains the name of the boot entry you want to move.
4. Use the arrow keys to move the line up or down in the list.
5. Save the changes and exit the GRUB bootloader.
Your Windows installation should now be listed in the desired order in GRUB.
Q: How do I delete a Windows boot entry from GRUB?
A: To delete a Windows boot entry from GRUB, follow these steps:
1. Boot into the GRUB bootloader.
2. Press the e key to edit the current boot configuration.
3. Find the line that starts with `menuentry` and contains the name of the Windows installation you want to delete.
4. Press the d key to delete the line.
5. Save the changes and exit the GRUB bootloader.
Your Windows installation should now be removed from GRUB.
In this blog post, we discussed how to add a Windows boot entry to GRUB. We covered the steps on how to do this on both a UEFI and BIOS system. We also provided some troubleshooting tips in case you run into any problems.
Here are the key takeaways from this blog post:
- To add a Windows boot entry to GRUB on a UEFI system, you need to use the `efibootmgr` command.
- To add a Windows boot entry to GRUB on a BIOS system, you need to edit the `grub.cfg` file.
- If you are having trouble adding a Windows boot entry to GRUB, you can try the following troubleshooting tips:
- Make sure that the Windows installation media is properly connected to your computer.
- Make sure that the Windows boot files are located in the correct directory.
- Make sure that the Windows boot entry is configured correctly in GRUB.
We hope this blog post has been helpful. If you have any other questions about adding a Windows boot entry to GRUB, please feel free to leave a comment below.
Author Profile
-
Hatch, established in 2011 by Marcus Greenwood, has evolved significantly over the years. Marcus, a seasoned developer, brought a rich background in developing both B2B and consumer software for a diverse range of organizations, including hedge funds and web agencies.
Originally, Hatch was designed to seamlessly merge content management with social networking. We observed that social functionalities were often an afterthought in CMS-driven websites and set out to change that. Hatch was built to be inherently social, ensuring a fully integrated experience for users.
Now, Hatch embarks on a new chapter. While our past was rooted in bridging technical gaps and fostering open-source collaboration, our present and future are focused on unraveling mysteries and answering a myriad of questions. We have expanded our horizons to cover an extensive array of topics and inquiries, delving into the unknown and the unexplored.
Latest entries
No, i did not update /boot/grub/grub.cfg, and doing so indeed fixed the problem (
sudo grub-mkconfig -o /boot/grub/grub.cfg
), Thanks everybody!
in grub, I now see
Arch Linux
Advanced options for Arch Linux
Windows Boot Manager (on /dev/nvme0n1p1)
UEFI Boot options
Windows
Windows
I managed to remove one of the «Windows» options by removing the added part in /etc/grub.d/40_custom, but the other one is still there
I dont necessarily need to remove it, I can live with it there, but it would be nice not to have it twice
also, if I try to boot into it, it says that there is no drive named /dev/nvme0n1p1, but that might also be due to a typo somewhere
I could select it from grub, press e to edit it and delete everything, but how would I save it, then?
Also, since Head_on_a_stick asked, there you go
NAME FSTYPE FSVER LABEL UUID FSAVAIL FSUSE% MOUNTPOINTS
sda
├─sda1 vfat FAT32 25E3-EB55
├─sda2 ext4 1.0 b46decfc-a738-4af2-8c3f-c09b0d31b848 95.8G 18% /
└─sda3 ntfs Storage 62E463EDE463C241
nvme0n1
├─nvme0n1p1 vfat FAT32 SYSTEM 4224-04AA
├─nvme0n1p2
├─nvme0n1p3 ntfs System B8E4EF37E4EEF692
└─nvme0n1p4 ntfs Windows RE Tools 928283FC8283E359
and also
BootCurrent: 0000
Timeout: 0 seconds
BootOrder: 0000,0005,0001,0006,0007,0003,0004,0002
Boot0000* grub_uefi HD(1,GPT,3c5c541b-6770-bd45-92b8-2167c847db31,0x800,0x113000)/File(\EFI\grub_uefi\grubx64.efi)
Boot0001* Windows Boot Manager HD(1,GPT,0d53e022-342b-48c3-ad87-8978e02ca33a,0x800,0x82000)/File(\EFI\Microsoft\Boot\bootmgfw.efi)䥗䑎坏S
Boot0002* WDC PC SN520 SDAPNUW-256G-1006-192899801574 PciRoot(0x0)/Pci(0x1d,0x4)/Pci(0x0,0x0)/NVMe(0x1,00-1B-44-8B-44-0E-71-7B)걎脈鼑䵙ⱒ뉙
Boot0003* IPV4 Network PciRoot(0x0)/Pci(0x14,0x0)/USB(5,0)/USB(3,0)/MAC(64c901c82bc6,0)/IPv4(0.0.0.00.0.0.0,0,0)걎脈鼑䵙ⱒ뉙
Boot0004* IPV6 Network PciRoot(0x0)/Pci(0x14,0x0)/USB(5,0)/USB(3,0)/MAC(64c901c82bc6,0)/IPv6([::]:<->[::]:,0,0)걎脈鼑䵙ⱒ뉙
Boot0005 USB: PciRoot(0x0)/Pci(0x14,0x0)걎脈鼑䵙ⱒ뉙耋
Boot0006* IPV4 Network - Realtek PCIe GBE Family Controller PciRoot(0x0)/Pci(0x1d,0x0)/Pci(0x0,0x0)/MAC(f8b46aa8c23b,0)/IPv4(0.0.0.00.0.0.0,0,0)걎脈鼑䵙ⱒ뉙
Boot0007* IPV6 Network - Realtek PCIe GBE Family Controller PciRoot(0x0)/Pci(0x1d,0x0)/Pci(0x0,0x0)/MAC(f8b46aa8c23b,0)/IPv6([::]:<->[::]:,0,0)걎脈鼑䵙ⱒ뉙
I usually run Ubuntu and Windows on the same computer, in order to be able to select which OS I want to boot, I use GRUB. Here we’re going to learn how to add Windows 10 to the GRUB OS list.
Using your Ubuntu OS you need to know which partition is the Windows EFI located, mine is at /dev/sda2
.
Once you know it, you should run the following command adapting it to your partition.
sudo blkid /dev/sda2
Enter fullscreen mode
Exit fullscreen mode
This command will allow you to know the UUID of your Windows EFI partition.
Next, we need to edit the /etc/grub.d/40_custom
file in order to add the Windows 10 entry.
sudo vi /etc/grub.d/40_custom
Enter fullscreen mode
Exit fullscreen mode
Here is the entry you should add, change WINDOWS_EFI_PARTITION_UUID
with the value you obtained previously.
menuentry "Windows 10" --class windows --class os {
insmod ntfs
search --no-floppy --set=root --fs-uuid WINDOWS_EFI_PARTITION_UUID
ntldr /bootmgr
}
Enter fullscreen mode
Exit fullscreen mode
Sometimes the GRUB menu is hidden by default on boot, you should enable it changing the GRUB configuration.
sudo vi /etc/default/grub
Enter fullscreen mode
Exit fullscreen mode
You should set the timeout seconds, and comment out the default style.
GRUB_TIMEOUT=5
#GRUB_TIMEOUT_STYLE=hidden
Enter fullscreen mode
Exit fullscreen mode
Once you’ve made all the changes, you should apply them by running the following command.
sudo update-grub
Enter fullscreen mode
Exit fullscreen mode
Skip to content
After a recent malware attack in my Windows 10 PC, I was unable to use it for many days. So this time I decided to install both Windows 10 and Ubuntu 16.04.3 in the dual boot configuration, so that if Windows fails to boot, I can still access all my files using the Ubuntu. And of course, you can always use the powerful Ubuntu Linux on the same PC any time you want. But after installing Ubuntu 16.04.3 on the Windows 10 PC, I found no way to use Windows 10 as the Ubuntu setup somehow failed to add the Windows entry to the Grub menu.
If you are also experiencing a similar problem then you can quickly fix this problem using just two commands. Here is how:
- Boot into Ubuntu (well, there is no other option at the moment but to boot into Ubuntu).
- Press Ctrl + Alt + T to open the terminal window.
- In the terminal window type the following command: sudo os-prober and press Enter.
- If you see it detect Windows 10 then all you have to do is type the command sudo update-grub and press Enter. It will add new entries to the grub menu and update it. Now you can reboot your PC and you will see options to boot into Windows.
However, if you do not see the Windows 10 detected after issuing the sudo os-prober command, then you will have to use some extra steps. We have already posted about boot-repair utility that can be used from within Linux to fix most of the boot problems. You can read more about the boot-repair utility from how to restore Ubuntu Linux after re-installing Windows. This tool should be enough to fix the problems and you will never need any of the commands to be used manually or to edit the grub menu by yourself.
We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept”, you consent to the use of ALL the cookies.