DEV Community

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

Posted on • Edited 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

Do your career a big favor. Join DEV. (The website you're on right now)

It takes one minute, it's free, and is worth it for your career.

Get started

Community matters

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Explore a sea of insights with this enlightening post, highly esteemed within the nurturing DEV Community. Coders of all stripes are invited to participate and contribute to our shared knowledge.

Expressing gratitude with a simple "thank you" can make a big impact. Leave your thanks in the comments!

On DEV, exchanging ideas smooths our way and strengthens our community bonds. Found this useful? A quick note of thanks to the author can mean a lot.

Okay