Return to efi setup from grub commandline

Super User Asked by AnnoyinC on December 5, 2020

EFI allows you to return to the EFI shell/setup when exiting a bootloader, thus it should be possible with grub(2), but I can’t figure it out. What commands do you need to run?

Of course you can run reboot but it’s not as elegant.

One Answer

"EFI Shell" is a different thing from the firmware setup screen. It refers to a MS-DOS-like interactive command line shell that runs within the EFI environment.

The EFI Shell works similarly to interactive shells on Linux/BSD. It is not the default starting point; it is just a normal .efi program that's launched on demand.

If you start GRUB or another .efi program from the EFI Shell, then exiting that program will return you back to the Shell. For GRUB2, there seems to be an undocumented exit command which does that. (If it doesn't work, you might have to use normal_exit followed by exit.)

But if you didn't run GRUB that way, then the only way to enter the EFI Shell is to start the Shell's own .efi executable (e.g. shellx64.efi). I'm not quite sure about GRUB2 but I think chainload can be used here.

(When GRUB is started through the normal boot process, exiting it will simply cause the next EFI boot entry to be attempted, according to your BootOrder configuration. At best, you will only reach the firmware setup screen when all EFI boot entries fail, including the built-in ones.)

As for returning to the setup interface, I don't know of a direct way, but there is an indirect way: set the OsIndications EFI variable, then reboot. During the next boot, the firmware will skip the usual boot entries and go straight into the setup screen.

In GRUB this can be done using the fwsetup command. It can also be done from Linux using systemctl reboot --firmware, and from Windows using shutdown /fw /r /t 0.

Note that OsIndications is a later addition to UEFI, and old firmwares might not support it.

Correct answer by user1686 on December 5, 2020

Add your own answers!

Related Questions

access to Azure Active Directory

0  Asked on December 19, 2020 by sudhakar-reddy


Unable to copy in bluestacks

2  Asked on December 18, 2020 by sagar


SSH Multiple Session -> “stdin: is not a tty”

1  Asked on December 18, 2020 by mijago


XenServer: Backing up VMs to NAS

0  Asked on December 17, 2020 by grumpy-ol-bear


VirtualBox is very slow in Windows 10

11  Asked on December 17, 2020 by ali


Sed for windows

2  Asked on December 17, 2020 by thesavo


Identify 4-pin power socket

0  Asked on December 16, 2020 by c_b


AT commands to activate CDMA modem?

0  Asked on December 16, 2020 by david-pfeffer


ssh-keyscan returns different values on each invocation

0  Asked on December 16, 2020 by sweetjonnie


less command does not open zip files on debian

2  Asked on December 16, 2020 by m-j


Ask a Question

Get help from others!

© 2023 All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP