Monday, May 6, 2024
 Popular · Latest · Hot · Upcoming
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 13093  / 3 Years ago, mon, september 27, 2021, 10:18:56

My issues started when I partitioned my Ubuntu 22.04 LTS drive to add Windows 11 (I used my Ubuntu bootable to partition the drive).


Once Windows 11 was installed, my computer began to boot Windows 11 instead of showing me the grub menu. I fixed this by entering the BIOS and moving Ubuntu to the top. My computer was booting into Ubuntu now, but I still wasn't seeing the grub menu.


After looking at this post, Why is Grub menu not shown when starting my computer?, I was able to get my grub menu to show again (@Akalgnotum). But Windows 11 was not included in the menu.


With the guidance of this post, GRUB does not detect Windows I ran:
sudo os-prober which returned /dev/nvme0n1p1@/EFI/Microsoft/Boot/bootmgfw.efi:Windows Boot Manager:Windows:efi. I then ran sudo update-grub which gave me this "warning":


Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.15.0-46-generic
Found initrd image: /boot/initrd.img-5.15.0-46-generic
Found linux image: /boot/vmlinuz-5.15.0-43-generic
Found initrd image: /boot/initrd.img-5.15.0-43-generic
Memtest86+ needs a 16-bit boot, that is not available on EFI, exiting
Warning: os-prober will not be executed to detect other bootable partitions.
Systems on them will not be added to the GRUB boot configuration.
Check GRUB_DISABLE_OS_PROBER documentation entry.
Adding boot menu entry for UEFI Firmware Settings ...
done

From what I gather, Windows won't be added by sudo update-grub because it won't run and use the information given by os-prober.


I have no idea how to fix this. Any suggestions would be extremely helpful. If more information is needed, I'll be happy to provide it.


Thanks!


More From » dual-boot

 Answers
6

After digging through the internet for days, I found an answer!


All credit goes to this post: https://askubuntu.com/a/977251/1191399. I am just reiterating it.



  1. sudo fdisk -l


You should get a long return that includes something like this:


Device             Start        End   Sectors   Size Type
/dev/nvme0n1p1 2048 1050623 1048576 512M EFI System
/dev/nvme0n1p2 1050624 874729471 873678848 416.6G Linux filesystem
/dev/nvme0n1p3 874729472 874762239 32768 16M Microsoft reserved
/dev/nvme0n1p4 874762240 1000214527 125452288 59.8G Microsoft basic data


  1. Get the UUID of the EFI partition
    sudo blkid /dev/nvme0n1p1 (replace nvme0n1p1 with the correct partition for you)


Return:
dev/nvme0n1p1: UUID="3C26-6A4C" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="EFI System Partition" PARTUUID="3b64b43f-e7eb-4ac8-a32c-9af2edf64d0d"



  1. Grant yourself write permission to the '40_custom' file in /etc/grub.d


    Open the terminal (ctrl+alt+t) and run the following commands:

    cd /etc/grub.d

    sudo chmod o+w 40_custom



  2. Open the 40_custom file

    open ./40_custom



  3. Write the following at the bottom of the file and replace 3C26-6A4C with the correct UUID:




menuentry 'Windows 11' {
search --fs-uuid --no-floppy --set=root 3C26-6A4C
chainloader (${root})/EFI/Microsoft/Boot/bootmgfw.efi
}


  1. Save the file and close the editor.



  2. Back in the terminal, remove write permissions.

    sudo chmod o-w 40_custom



  3. Update GRUB using sudo update-grub



  4. (Optional) You can confirm that your change was successful by going to /boot/grub/grub.cfg and checking lines 243-251. It should reflect your edits in the 40_custom file



  5. Reboot your computer reboot




[#280] Tuesday, September 28, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
montwim

Total Points: 103
Total Questions: 112
Total Answers: 120

Location: Vietnam
Member since Mon, Mar 14, 2022
2 Years ago
;