DEV Community

Cover image for Add Windows 10 to GRUB OS list
Sergio Peris
Sergio Peris

Posted on • Originally published at sertxu.dev

Add Windows 10 to GRUB OS list

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

Top comments (0)