Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Windows 10 broke my UEFI
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
Adrien
Advocate
Advocate


Joined: 13 Jul 2004
Posts: 2326
Location: Bretagne

PostPosted: Fri Nov 29, 2024 9:05 pm    Post subject: [SOLVED] Windows 10 broke my UEFI Reply with quote

Hi!

I've run into a UEFI mess after installing Windows 10 :roll:

Here's my setup:
/dev/nvme0n1p1 - Gentoo system, main drive
/dev/sda - Windows

I took care of unplugging all my hard drives before Windows install so it doesn't write it's bootmgr to /dev/nvme0n1 as it did before but now, I can't even see my gentoo drive in general BIOS menu. And I have to press F11 in order to see it and boot from it.

Re-running grub-install + grub-mkconfig did not reset things properly.

Trying to re-order boot entries with efibootmgr does not seem to work:
Code:

 trone ~ # efibootmgr
BootCurrent: 0004
Timeout: 1 seconds
BootOrder: 0004,0000,0003,0002,0005,0006
Boot0000* Windows Boot Manager   HD(2,GPT,2bbeaf8e-0dcb-4a7f-8580-c2aff2f60048,0x109000,0x31800)/\EFI\MICROSOFT\BOOT\BOOTMGFW.EFI57
Boot0001* Hard Drive   BBS(HD,,0x0)/VenHw(
Boot0002* UEFI: Built-in EFI Shell   VenMedia(5023b95c-db26-429b-a648-bd47664c8012)0000424f
Boot0003* CD/DVD Drive   BBS(CDROM,,0x0)/VenHw(
Boot0004* gentoo   HD(1,GPT,d557d33b-cb74-410c-81a9-7fec8455107f,0x800,0x200000)/\EFI\gentoo\grubx64.efi
Boot0005* UEFI OS   HD(1,GPT,d557d33b-cb74-410c-81a9-7fec8455107f,0x800,0x200000)/\EFI\BOOT\BOOTX64.EFI0000424f
Boot0006* USB HDD   BBS(HD,,0x0)/VenHw


And after issuing the proper command:

Code:
trone ~ # efibootmgr -o 0004,0000,0003,0002,0005,0006
BootCurrent: 0004
Timeout: 1 seconds
BootOrder: 0004,0000,0003,0002,0005,0006
Boot0000* Windows Boot Manager   HD(2,GPT,2bbeaf8e-0dcb-4a7f-8580-c2aff2f60048,0x109000,0x31800)/\EFI\MICROSOFT\BOOT\BOOTMGFW.EFI
Boot0001* Hard Drive   BBS(HD,,0x0)/VenHw
Boot0002* UEFI: Built-in EFI Shell   VenMedia(5023b95c-db26-429b-a648-bd47664c8012)0000424f
Boot0003* CD/DVD Drive   
BBS(CDROM,,0x0)/VenHw(5ce8128b-2cec-40f0-8372-80640e3dc858,0300)
0000474f00004e4fcb00000001000000850048004c002d00440054002d00530054002000420
0440044005600440052005700200043004800310030004c0053003200380000000501090003
00000000010416008b12e85cec2cf040837280640e3dc85803007fff040002010c00d041030
a0000000001010600001703120a000300ffff00007fff040001043e00ef47642dc93ba041ac
194d51d01b4ce639004b0044003700470033003300490035003600200038002000200020002
000200020002000200000007fff04000000424f
Boot0004* gentoo   HD(1,GPT,d557d33b-cb74-410c-81a9-7fec8455107f,0x800,0x200000)/\EFI\gentoo\grubx64.efi
Boot0005* UEFI OS   HD(1,GPT,d557d33b-cb74-410c-81a9-7fec8455107f,0x800,0x200000)/\EFI\BOOT\BOOTX64.EFI0000424f
Boot0006* USB HDD   BBS(HD,,0x0)/VenHw


Order does not get modified as wanted.
Don't really know where to go from now, so any advice would be greatly appreciated

Thank you for your attention and support. :D

Cast word-wrap on a long line to make the forum layout behave.Chiitoo


Last edited by Adrien on Sun Dec 08, 2024 9:20 pm; edited 1 time in total
Back to top
View user's profile Send private message
ajgringo619
n00b
n00b


Joined: 01 Nov 2022
Posts: 32

PostPosted: Sat Nov 30, 2024 2:21 am    Post subject: Reply with quote

There's no difference in the boot order from either command. What exactly are you trying to accomplish?
Back to top
View user's profile Send private message
Adrien
Advocate
Advocate


Joined: 13 Jul 2004
Posts: 2326
Location: Bretagne

PostPosted: Sat Nov 30, 2024 7:55 am    Post subject: Reply with quote

ajgringo619 wrote:
There's no difference in the boot order from either command. What exactly are you trying to accomplish?


:oops: yep, I forgot to say that indeed.

I want gentoo back as first and main boot option. I should be able to boot Windeow from grub entry.
Indeed, changing boot order with efibootmgr does not work: that is my problem.
Back to top
View user's profile Send private message
Adrien
Advocate
Advocate


Joined: 13 Jul 2004
Posts: 2326
Location: Bretagne

PostPosted: Sat Nov 30, 2024 11:51 am    Post subject: Reply with quote

And a question I may add is: if I delete the Windows entry will the os still be bootable from grub menu? If anyone knows :roll:
Back to top
View user's profile Send private message
keekkenen
n00b
n00b


Joined: 05 Oct 2024
Posts: 14

PostPosted: Sat Nov 30, 2024 12:33 pm    Post subject: Reply with quote

Adrien wrote:

I want gentoo back as first and main boot option. I should be able to boot Windeow from grub entry.
Indeed, changing boot order with efibootmgr does not work: that is my problem.

You can change boot priority in BIOS, for example.

Adrien wrote:
And a question I may add is: if I delete the Windows entry will the os still be bootable from grub menu? If anyone knows :roll:

You can, but how will you boot Windows ?
_________________
7950x3d / x670e MSI Tomagawk / Sapphire RX 7800XT 16Gb / G.Skill 64Gb 5600 / A-Data Legend 960 2Tb (x2), A-Data SX8200PNP 256Gb
Back to top
View user's profile Send private message
sMueggli
Guru
Guru


Joined: 03 Sep 2022
Posts: 514

PostPosted: Sat Nov 30, 2024 12:45 pm    Post subject: Reply with quote

Windows did not broke your UEFI (and by the way: the support for Win 10 ends next year).

If you cannot change the boot order with efibootmgr, then you should be able to change the boot order from inside the UEFI settings. The ways how boot entries are handled vary from vendor to vendor. If you delete the Windows boot entry, it might be regenerated by the UEFI firmware.

Another alternative: Use the ESP from windows and mount it to /boot/efi (or /efi or whatever you have) and reinstall Grub and regenerate the Grub configuration. (Or boot Grub from the Windows bootloader).
Back to top
View user's profile Send private message
Adrien
Advocate
Advocate


Joined: 13 Jul 2004
Posts: 2326
Location: Bretagne

PostPosted: Sat Nov 30, 2024 12:47 pm    Post subject: Reply with quote

Nope, as written in my first message, my nvme drive (gentoo) does no longer appear in BIOS settings.
Back to top
View user's profile Send private message
CaptainBlood
Advocate
Advocate


Joined: 24 Jan 2010
Posts: 3977

PostPosted: Sat Nov 30, 2024 4:31 pm    Post subject: Reply with quote

How does it behave if you disconnect your M$ hard drive?

It could be windows command bcdedit could be a clue entry point...
There are GUI tools aimed to ease things up that do bcdedit under the hood.
Can't remember name fpr such freeware, but I recall that exists.

I may not match your use case.
U don't provide much element such as does the original UEFI partition (I suspect to exist) remains?
Has window installed a UEFI partition on its own disk?

Thks 4 ur attention, interest & support.
_________________
USE="-* ..." in /etc/portage/make.conf here, i.e. a countermeasure to portage implicit braces, belt & diaper paradigm
LT: "I've been doing a passable imitation of the Fontana di Trevi, except my medium is mucus. Sooo much mucus. "
Back to top
View user's profile Send private message
Adrien
Advocate
Advocate


Joined: 13 Jul 2004
Posts: 2326
Location: Bretagne

PostPosted: Sun Dec 08, 2024 9:10 pm    Post subject: Reply with quote

sMueggli wrote:
If you cannot change the boot order with efibootmgr, then you should be able to change the boot order from inside the UEFI settings.

Nope, I can't do this, that's the point.

sMueggli wrote:
The ways how boot entries are handled vary from vendor to vendor. If you delete the Windows boot entry, it might be regenerated by the UEFI firmware.

Thank you for this tip :)

sMueggli wrote:
Another alternative: Use the ESP from windows and mount it to /boot/efi (or /efi or whatever you have) and reinstall Grub and regenerate the Grub configuration. (Or boot Grub from the Windows bootloader).

This is what I wanted to avoid and what led me here. I'll re-explain more precisely what I did:

1- Gentoo installed on nvme0n1 - No windows nowhere
2- Added a ssd drive and installed Win10 on it (/dev/sda), Windows wrote its bootloader to my /boot/efi, which I didn't like. I could still see my nvme gentoo drive in BIOS settings at this point.
3- I removed this windows bootloader from /boot/efi with efibootmgr and deleted the relevant folders from windows
4- Unplugged all drives but sda and reinstalled Win10 on it, this time Win bootloader went on the sda drive (luckily ^^)
5- Replugged all my drives and rebooted:
> boots on Win10 by default
> gentoo and nvme disappeared from BIOS settings
> gentoo and nvme still appearing in the menu if I press F11 at startup and gentoo boots properly.

Here are the two partitions for the two OSes:

Code:
trone ~ # os-prober
/dev/sda2@/efi/Microsoft/Boot/bootmgfw.efi:Windows Boot Manager:Windows:efi


Code:
trone ~ # efibootmgr
Boot0004* gentoo   HD(1,GPT,d557d33b-cb74-410c-81a9-7fec8455107f,0x800,0x200000)/\EFI\gentoo\grubx64.efi


CaptainBlood wrote:
How does it behave if you disconnect your M$ hard drive?

Still have to check this

CaptainBlood wrote:
It could be windows command bcdedit could be a clue entry point...
There are GUI tools aimed to ease things up that do bcdedit under the hood.
Can't remember name fpr such freeware, but I recall that exists.


Seems there is Visual BCD Editor, I'll give it a try
Back to top
View user's profile Send private message
Adrien
Advocate
Advocate


Joined: 13 Jul 2004
Posts: 2326
Location: Bretagne

PostPosted: Sun Dec 08, 2024 9:19 pm    Post subject: Reply with quote

Adrien wrote:

3- I removed this windows bootloader from /boot/efi with efibootmgr and deleted the relevant folders from windows


I was pretty sure I did this properly but after checking /boot/efi, there was still a "Boot" folder with Win trash inside...
Removed it and we're back to grub menu as default.
Also had to remove this entry with efibootmgr:
Code:
Boot0005* UEFI OS   HD(1,GPT,d557d33b-cb74-410c-81a9-7fec8455107f,0x800,0x200000)/\EFI\BOOT\BOOTX64.EFI0000424f


Thanks very much to all of you for your support! :) :idea:


Last edited by Adrien on Mon Dec 09, 2024 6:21 pm; edited 1 time in total
Back to top
View user's profile Send private message
CaptainBlood
Advocate
Advocate


Joined: 24 Jan 2010
Posts: 3977

PostPosted: Sun Dec 08, 2024 10:08 pm    Post subject: Reply with quote

So you can you boot M$ from grub, don't you?
I you can, do you still get grub at next reboot?

Thks 4 ur attention, interest & support.
_________________
USE="-* ..." in /etc/portage/make.conf here, i.e. a countermeasure to portage implicit braces, belt & diaper paradigm
LT: "I've been doing a passable imitation of the Fontana di Trevi, except my medium is mucus. Sooo much mucus. "
Back to top
View user's profile Send private message
Adrien
Advocate
Advocate


Joined: 13 Jul 2004
Posts: 2326
Location: Bretagne

PostPosted: Mon Dec 09, 2024 6:22 pm    Post subject: Reply with quote

CaptainBlood wrote:
So you can you boot M$ from grub, don't you?
I you can, do you still get grub at next reboot?

Thks 4 ur attention, interest & support.

Yes I do, for both, that is what I needed.
Apologies if I have been unclear with my needs and details by the way :)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum