Command to reset NVRAM?

10,199

efibootmgr is a userspace application used to modify the Intel Extensible Firmware Interface (EFI) Boot Manager. This application can create and destroy boot entries, change the boot order, change the next running boot option, and more.

It is available for all currently supported versions of Ubuntu.

You can check to see if it's installed with which efibootmgr which on my system returns:

/bin/efibootmgr

sudo efibootmgr will list the current entries.

You should get results similar to this:

 BootCurrent: 0004
       BootNext: 0003
       BootOrder: 0004,0000,0001,0002,0003
       Timeout: 30 seconds
       Boot0000* Diskette Drive(device:0)
       Boot0001* CD-ROM Drive(device:FF)
       Boot0002* Hard Drive(Device:80)/HD(Part1,Sig00112233)
       Boot0003* PXE Boot: MAC(00D0B7C15D91)
       Boot0004* Linux

You can modify your non-default boot entries with the -b switch and delete them with the -B switch.

Assuming the output above, efibootmgr -b 4 -B could be called to delete entry 4 and remove it from the BootOrder. Of course you'll have to adjust accordingly for your circumstances.

For more detail on efibootmgr see the man page.

Share:
10,199

Related videos on Youtube

simgineer
Author by

simgineer

Updated on September 18, 2022

Comments

  • simgineer
    simgineer over 1 year

    I'd like to test cloning an image and it looks like when ubuntu starts up on my intel NUC for the first time it will set the nvram to use the /boot/efi/EFI/ubuntu/grubx64.efi boot loader. I'd like to unset this if possible to test and verify and was wondering if there is a command that can be used to unset NVRAM to its defaults.