boot loader

Latest response

hi, i am new to linux. i have dual boot - win 10 & RHEL 8. i want set win 10 as default OS. i am aware how to do it.
Thanks

Responses

Hi Babul,

I am do not understand the description, are you asking for help?

Regards,

Jan Gerrit Kootstra

Hi Gerrit, Thanks for your response. Yes exactly, i need help to solve the issue. i am using a dual boot (win 10 & RHEL 8) which automatically starts Linux. I want to set win 10 as my default OS. Please help!

Hi Babul,

Execute sudo efibootmgr -v to check for the boot entry numbers.
Then execute sudo efibootmgr -o x,y to change the boot order.
Replace "x" and "y" with the numbers given from the first command. :)

Regards,
Christian

root@localhost babul]# sudo efibootmgr -v BootCurrent: 0008 Timeout: 0 seconds BootOrder: 0008,0003,2003,0000,0001,2001,2002 Boot0000* ST1000LM035-1RK172 BBS(HD,ST1000LM035-1RK172 ,0x500)................-...........A......................................o.. Boot0001 Realtek PXE B01 D00 BBS(128,Realtek PXE B01 D00,0x0)....................................................................... Boot0003* Windows Boot Manager HD(2,GPT,242f42a4-8e8a-4cba-8e4a-cf18d6b07fcd,0xe1800,0x32000)/File(\EFI\Microsoft\Boot\bootmgfw.efi)RC Boot0005* EFI Network 0 for IPv4 (7C-8A-E1-1B-F7-76) PciRoot(0x0)/Pci(0x1c,0x0)/Pci(0x0,0x0)/MAC(7c8ae11bf776,0)/IPv4(0.0.0.00.0.0.0,0,0)RC Boot0006* EFI Network 0 for IPv6 (7C-8A-E1-1B-F7-76) PciRoot(0x0)/Pci(0x1c,0x0)/Pci(0x0,0x0)/MAC(7c8ae11bf776,0)/IPv6([::]:<->[::]:,0,0)RC Boot0007* Windows Boot Manager HD(2,GPT,242f42a4-8e8a-4cba-8e4a-cf18d6b07fcd,0xe1800,0x32000)/File(\EFI\Microsoft\Boot\bootmgfw.efi)WINDOWS.........x...B.C.D.O.B.J.E.C.T.=.{.9.d.e.a.8.6.2.c.-.5.c.d.d.-.4.e.7.0.-.a.c.c.1.-.f.3.2.b.3.4.4.d.4.7.9.5.}...a................ Boot0008* Red Hat Enterprise Linux HD(2,GPT,242f42a4-8e8a-4cba-8e4a-cf18d6b07fcd,0xe1800,0x32000)/File(\EFI\redhat\shimx64.efi) Boot2001* EFI USB Device RC Boot2002* EFI DVD/CDROM RC Boot2003* EFI Network RC

this is what i get. i am unable to understand. can you help me further

ooh!!!! after i execute sudo efibootmgr -o 0003,0008

and i restarted but this time i see nothing and started directly in win 10

linux no more shown at boot up

Hi Babul,

You have two options : either add RHEL to the Windows boot menu ... or select RHEL in the BIOS. :)

Regards,
Christian

Hi Babul,

For your convenience and just in case you don't know how to add RHEL to the Win boot loader,
please open a Command prompt as Administrator, and execute the two following commands. :)

bcdedit /copy {current} /d "Red Hat Enterprise Linux"
bcdedit /set {guid} path \EFI\redhat\shimx64.efi

Replace "guid" with the identifier being given from the first command - hope it could help you.

Regards,
Christian

Dear Christian Labisch,

Thank you for your! Well i couldn't solve the problem that's why i reinstalled again. this time i will wait for your direction. kindly refer the details below and guide through to set win 10 as default OS.

[root@localhost precis]# sudo efibootmgr -v BootCurrent: 0008 Timeout: 0 seconds BootOrder: 0008,0002,0004,2003,0001,0000,0003,2001,2002 Boot0000* Realtek PXE B01 D00 BBS(128,Realtek PXE B01 D00,0x0)....................................................................... Boot0001* ST1000LM035-1RK172 BBS(HD,ST1000LM035-1RK172 ,0x500)................-...........A......................................o.. Boot0002 Windows Boot Manager HD(2,GPT,242f42a4-8e8a-4cba-8e4a-cf18d6b07fcd,0xe1800,0x32000)/File(\EFI\Microsoft\Boot\bootmgfw.efi)RC Boot0003* SanDisk BBS(HD,SanDisk,0x500)..................d.......b...f.....................................o.. Boot0004* Linpus lite HD(1,MBR,0x6b8b4567,0x5cdc,0x4f9c)/File(\EFI\Boot\grubx64.efi)RC Boot0005* EFI Network 0 for IPv4 (7C-8A-E1-1B-F7-76) PciRoot(0x0)/Pci(0x1c,0x0)/Pci(0x0,0x0)/MAC(7c8ae11bf776,0)/IPv4(0.0.0.00.0.0.0,0,0)RC Boot0006* EFI Network 0 for IPv6 (7C-8A-E1-1B-F7-76) PciRoot(0x0)/Pci(0x1c,0x0)/Pci(0x0,0x0)/MAC(7c8ae11bf776,0)/IPv6([::]:<->[::]:,0,0)RC Boot0007* Windows Boot Manager HD(2,GPT,242f42a4-8e8a-4cba-8e4a-cf18d6b07fcd,0xe1800,0x32000)/File(\EFI\Microsoft\Boot\bootmgfw.efi)WINDOWS.........x...B.C.D.O.B.J.E.C.T.=.{.9.d.e.a.8.6.2.c.-.5.c.d.d.-.4.e.7.0.-.a.c.c.1.-.f.3.2.b.3.4.4.d.4.7.9.5.}...a................ Boot0008* Red Hat Enterprise Linux HD(2,GPT,242f42a4-8e8a-4cba-8e4a-cf18d6b07fcd,0xe1800,0x32000)/File(\EFI\redhat\shimx64.efi) Boot2001* EFI USB Device RC Boot2002* EFI DVD/CDROM RC Boot2003* EFI Network RC [root@localhost precis]# ^C [root@localhost precis]#

Regards

Hi Babul,

I think best would be is to leave it as it is for the time being ... what you're trying to achieve
requires having advanced knowledge - about how different boot loaders work on different
operating systems with the EFI. Just use the GRUB boot loader - and boot the system you
want to boot from there. This is my recommendation at least. And all possibilities to handle
multi-boot scenarios have one thing in common, they need extra steps to boot a system. :)

Regards,
Christian

Hi, Acknowledged and appreciate your concern thanks! Looking forward. Regards

You're welcome, Babul ! :)

By the way,

this command (sudo efibootmgr -o x,y) seems to be working. i am just unable to identify correctly the value of x & y based on the boot entry.

anyway thanks again for your concern

Hi Babul,

0002 (x) = Wiindows and 0008 (y) = RHEL ... so 0002,0008 (x,y) sets Windows as the first
option to boot ... that means the Windows boot environment starts, and not the RHEL boot
environment. So you have to add the RHEL entry manually to the Windows environment. :)

Regards,
Christian

Hi Christian Labisch,

which means i can give this command by opening the terminal

sudo efibootmgr -0 0002, 0008

please correct me if i am wrong. Thanks again!

Hi Babul,

No, it has to be -o and without a space between the numbers : sudo efibootmgr -o 0002,0008
But don't forget, it means that you have to add RHEL manually to the Windows boot loader menu.
Or, you can/have to boot to the BIOS in order to invoke the RHEL boot environment from there. :)

Regards,
Christian

[root@localhost precis]# sudo efibootmgr -v

BootCurrent: 0008 Timeout: 0 seconds BootOrder: 0008,0002,2003,0001,0000,2001,2002 Boot0000* Realtek PXE B01 D00 BBS(128,Realtek PXE B01 D00,0x0)....................................................................... Boot0001* ST1000LM035-1RK172 BBS(HD,ST1000LM035-1RK172 ,0x500)................-...........A......................................o.. Boot0002 Windows Boot Manager HD(2,GPT,242f42a4-8e8a-4cba-8e4a-cf18d6b07fcd,0xe1800,0x32000)/File(\EFI\Microsoft\Boot\bootmgfw.efi)RC Boot0005* EFI Network 0 for IPv4 (7C-8A-E1-1B-F7-76) PciRoot(0x0)/Pci(0x1c,0x0)/Pci(0x0,0x0)/MAC(7c8ae11bf776,0)/IPv4(0.0.0.00.0.0.0,0,0)RC Boot0006* EFI Network 0 for IPv6 (7C-8A-E1-1B-F7-76) PciRoot(0x0)/Pci(0x1c,0x0)/Pci(0x0,0x0)/MAC(7c8ae11bf776,0)/IPv6([::]:<->[::]:,0,0)RC Boot0007* Windows Boot Manager HD(2,GPT,242f42a4-8e8a-4cba-8e4a-cf18d6b07fcd,0xe1800,0x32000)/File(\EFI\Microsoft\Boot\bootmgfw.efi)WINDOWS.........x...B.C.D.O.B.J.E.C.T.=.{.9.d.e.a.8.6.2.c.-.5.c.d.d.-.4.e.7.0.-.a.c.c.1.-.f.3.2.b.3.4.4.d.4.7.9.5.}...a................ Boot0008* Red Hat Enterprise Linux HD(2,GPT,242f42a4-8e8a-4cba-8e4a-cf18d6b07fcd,0xe1800,0x32000)/File(\EFI\redhat\shimx64.efi) Boot2001* EFI USB Device RC Boot2002* EFI DVD/CDROM RC Boot2003* EFI Network RC [root@localhost precis]#

Hi Babul,

The output tells you that the RHEL environment is currently set as the first option to boot. :)

Regards,
Christian

Dear Christian Labisch,

Hope you doing well? Sorry to trouble you but i am still in the same problem. Can you try helping me again based on the following:

after i execute sudo efibootmgr -o 0002,0008

again at the boot up linux didn't show up

then i execute the command in windows based on

bcdedit /copy {current} /d "Red Hat Enterprise Linux"

bcdedit /set {guid} path \EFI\redhat\shimx64.efi

but it displays as :

PS C:\Windows\system32> bcdedit /copy {current} /d "Red Hat Enterprise Linux" The copy command specified is not valid. Run "bcdedit /?" for command line assistance. The parameter is incorrect. PS C:\Windows\system32>

Regards

Hi Babul,

I don't know what's going wrong here ... did you open "Command prompt as Administrator" ? :)
As you can see in the Microsoft Docs - the command should create the identifier successfully.

Regards,
Christian

Hi Babul,

I've found a note in the Microsoft documentation, which could explain why it didn't work ... :)

If you are using Windows PowerShell, you must use quotes around the boot entry identifier,
for example: "{49916baf-0e08-11db-9af4-000bdbd316a0}" or "{current}".

So either use "Command prompt as Administrator" - or, use PowerShell and set the quotes.

Regards,
Christian

Dear Christian Labisch,

ooh! - Please refer now i got response this time:---

PS C:\Windows\system32> bcdedit/copy{current}/d"Red Hat Enterprise Linux"
bcdedit/copy : The term 'bcdedit/copy' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1 + bcdedit/copy{current}/d"Red Hat Enterprise Linux" + ~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (bcdedit/copy:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException

PS C:\Windows\system32>

As per your advice now i should write this quote

bcdedit/set{guid}path\EFI\redhat\shimx64.efi

however i don't know i should write in place of {guid}

regards

Hi Babul,

Can you please open "Command prompt as Administrator" to accomplish the operation ?
PowerShell is not exactly the recommended tool for that ... please follow my instructions.

Open a "Command prompt as Administrator" and execute the two following commands :

bcdedit /copy {current} /d "Red Hat Enterprise Linux"
bcdedit /set {guid} path \EFI\redhat\shimx64.efi

Replace "guid" with the identifier that was returned from the first (/copy) command ... :)

Regards,
Christian

Dear Christian Labisch,

I have done exactly what you have written and this time it was successful. Both the OS shows up at the boot now. However, when i choose Red Hat Enterprise Linux, it does not work instead it goes into "Preparing automatice repair" - "Diagnosing" - "Attempting repair" and finally shows up unable to repair.

How can i go about?

regards

Hi Babul,

When you select RHEL from the Windows boot menu, it should invoke the GRUB boot menu.
From there it should automatically boot into RHEL, unless you select the rescue boot option.
No idea, why it automatically boots into rescue mode. Select the latest kernel entry from the
GRUB boot menu and reinstall the kernel from within RHEL to make this being the default. :)

Regards,
Christian

Hi Babul,

Just to let you know ... this is what it would have to be when you use PowerShell :

bcdedit /copy "{current}" /d "Red Hat Enterprise Linux"
bcdedit /set "{guid}" path \EFI\redhat\shimx64.efi

And by the way, I am using Red Hat products ... Microsoft forums exist as well ! :)

Regards,
Christian

Hi Christian Labisch,

how are you?

After trying all options i couldn't find the solution and i had to reinstall both win 10 and rhel 8. I i will need more knowledge and until then i will remain as it is.

i am hoping if you can help me again this time - in setting the selection timeout of OS either make it remain still until i choose or atleast keep longer timeout. it is by default choosing linux in a very duration of 5 sec.

Regards

Hi Babul,

Good decision to stick with the default GRUB boot environment ! :)
You can change the timeout in the /etc/default/grub file - execute :
sudo vi /etc/default/grub
Change the time in the line GRUB_TIMEOUT=5 to what you want ...

Regards,
Christian

hi Christian Labisch,

after i change to 60 by giving sudo vi /etc/default/grub

and restarted nothing changes. it is still the same. did i miss something

Regards

Hi Babul,

Seems you forgot to update the GRUB configuration afterwards. :)
sudo grub2-mkconfig -o /boot/efi/EFI/redhat/grub.cfg

Regards,
Christian

Dear Christian Labisch,

i actually did tried few commands to update but i guess all wrong.

Now it is working fine after giving the command sudo grub2-mkconfig -o /boot/efi/EFI/redhat/grub.cfg

you have asked. thank you!

As i have said in the beginning that i am new to linux. i hope you will bear with me.

Btw if i put the of timeout as (-1), will it remain still until i interrupt. purpose is to not set any timeout value until action from the user.

Thank you once again.

Regards.

You're welcome, Babul ! I'm glad that you appreciate my/our assistance and help. :)
Timeout -1 ??? Don't know what this could be good for ... if you want, play with it ...

Regards,
Christian

Hi Christian Labisch,

New problem occurred again - the menu displaying the list of OS at the boot up is not showing and instead it goes directly into windows. Initially it shows without a problem but after few number of restart say five to ten restart the menu stops showing. This has repeated again and again. I have even reinstalled Linux for about four times hoping that this problem would go away as i didn't know what to do. Please give some options to solve this issue.

I did reinstalled yesterday again and today the problem resurface again.

Regards

Hi Babul,

One important thing : Disable "fast startup" in the Windows system settings and check after every Windows
update if it was not reset, the problem is that Microsoft often ignores user settings and in many cases those
updates even override the boot loader. When this happens, you'll have to boot from the installation medium
and reinstall GRUB. If it was my machine, I would wipe out Windows, install RHEL and then reinstall Windows
in a KVM virtual machine. It is your choice of course, but as long as Windows is installed, there's extra work. :)

Regards,
Christian

Hi Babul,

Does this always happen or only if you booted to Windows 10 before turning of the system? If the latter is the case, it might not be a Linux issue, but a Windows 10 issue.

It might be that Windows 10 overwites the boot sector of the disk.

I see many posts in the Ubuntu forums of people complaining that the latest Windows 10 updates break their Linux/Windows 10 dual boot.

Regards,

Jan Gerrit

Hi ir. Jan Gerrit Kootstra ,

Is there a solution to this? How can i revive?

Regards