8

a friend of mine gave me their old HP laptop and installed Ubuntu 22.04 on it for me. Unfortunately I cannot give specifics about the installation as I'm not aware how it was performed. The installation seems mostly successful as it is possible to successfully boot to Ubuntu if the following options are selected from the boot menu:

  1. Boot from EFI file
  2. Select file system Acpi(PNP0A03... (the only available option)
  3. EFI
  4. ubuntu
  5. grubx64.efi

However if the machine boots on it's own, it enters a boot loop where the text Reset System flashes briefly on each loop: Screenshot of small error

I've read posts on similar issues and the majority point towards

  • turning off secure boot (have tried on and off as some say it should be enabled while others say it shouldn't - same error is given regardless though).
  • turning off fast boot
  • boot mode = UEFI Native (Without CSM)
  • UEFI Boot Order has Customized Boot first

I have the above set accordingly however the boot loop persists. My guess is that the boot order is wrong because it can boot successfully manually, but I'm not certain as this is a first attempt at setting up Ubuntu.

Current UEFI Boot Order

Boot options pt 1

Boot options pt 2

Similar issues but not been able to find a successful resolution on these threads.

https://www.reddit.com/r/linux4noobs/comments/ppas7l/linux_stuck_on_infinite_reset_system_loop_when/ https://www.reddit.com/r/Ubuntu/comments/8p4h4f/continuous_loop_of_not_booting/ Ubuntu 22.04 Reset System Bootloop

Thank you

D.Yvel
  • 81
  • "customized boot" is unchecked in boot options, try checking that off and selecting the correct EFI file to boot from (assuming that's what the option does, I don't know for sure) – Esther Jul 04 '22 at 19:26
  • Ah good spot, when booting manually from EFI file the file path is \EFI\ubuntu\grubx64.efi (I'm not sure why the file path is given with backslashes).

    The customised boot option allows you to enter a path, but backslahes are not allowed so I've entered /EFI/ubuntu/grubx64.efi. Gave this a go but unfortunately no luck and it's still looping.

    – D.Yvel Jul 04 '22 at 20:43
  • One of the related threads advised to make a boot repair report: https://paste.ubuntu.com/p/Gzs3TFnV3f/

    Not entirely sure what to make of it though. I see that sda2 has no OS, but the boot files that work when trying manually.

    – D.Yvel Jul 04 '22 at 21:09

1 Answers1

1

TLDR summary: check the BIOS boot order is set to run the installed \EFI\Ubuntu\shimx64.efi boot loader first, rather than boot from a device (which will use the default \EFI\Boot\bootx64.efi path). The boot loop is caused by the HP BIOS and the Grub shim fallback EFI fbx64.efi both changing the EFI boot order and then running the other.

You might also consider removing \EFI\Boot\fbx64.efi to prevent the EFI boot order from being automatically and silently changed when you boot Ubuntu by selecting a device instead of an explicit EFI boot manager path.


Longer explanation:

I had this "Reset System" boot loop when booting a HP laptop with Ubuntu installed on an external USB drive. Manually selecting the Ubuntu bootloader at boot time (via ESC-F9 boot menu) worked, but the default boot failed with a boot loop. There was also the curious issue that booting Ubuntu changed the EFI boot entries. I will refer to the USB drive in the following text, because that's what I was using, but I believe this issue would also affect the internal drive in the same way.

The preconditions of the boot loop:

  • In HP BIOS Setup, the USB drive has higher priority than any OS installed boot manager. This can be seen inBoot Options > UEFI Boot Order, where USB Flash Drive appears above OS Boot Manager. Note this order does not appear to be the default - if you select Exit > Load Setup Defaults it will place OS Boot Manager first.

The actual loop is caused by:

  1. Laptop boots. The USB drive has higher boot priority in the BIOS, so the BIOS changes the EFI boot order to set the drive as the first entry, and then runs the default bootloader \EFI\Boot\bootx64.efi which is a Secure Boot shim that in turn runs EFI\Boot\fbx64.efi. fbx64.efi (aka fallback.efi) is a fallback boot manager described as:

Under any filename, fallback.efi is a sort of boot manager—but rather than present a menu of boot options, it scans the subdirectories of EFI on its own disk for files called BOOT.CSV, BOOTX64.CSV, or other architecture-specific variants of that filename. With this file found, it's read and processed to generate a new NVRAM entry. The program then launches the first of the new NVRAM entries it creates.

  1. The fallback boot manager detects that Ubuntu is installed and changes the EFI boot order to set \EFI\ubuntu\shimx64.efi as the first boot entry and reboots.

  2. Goto 1.


Although in this case the boot loop happened with an external USB drive, I believe the same thing would happen if Ubuntu were installed to any drive, and the HP BIOS were set to boot from the drive device (as opposed to the Ubuntu EFI bootloader). After Ubuntu is installed, the EFI boot entries will be something like:

# efibootmgr
Boot0002* Internal Hard Disk    PciRoot(0x0)/Pci(0x2,0x4)/Pci(0x0,0x0)/NVMe(0x1,00-00-00-00-00-00-00-00)/HD(1,GPT,...,0x800,0x82000)..BO
Boot0003* ubuntu    HD(1,GPT,...)/File(\EFI\ubuntu\shimx64.efi)

Note that there are separate entries for the drive itself, and the Ubuntu boot loader on the drive. If the BIOS is set to boot from the Hard Disk first, then on every boot it will change the EFI boot order to set the drive to be first entry, then run the \EFI\Boot fallback shim, which will in turn change the EFI boot order to set the \EFI\Ubuntu entry to be first and reboot. On reboot, the BIOS will change the boot order back, and thus starts the boot loop.


Debugging

Unfortunately the shim shows no output apart from Reset System. You can run mokutil --set-verbosity true and mokutil --set-fallback-verbosity true to turn on output, and mokutil --set-fallback-noreboot true to skip the reboot and run Ubuntu.

This related non-HP bug report for a boot loop on removable media suggests removing \EFI\Boot\fbx64.efi as a workaround to prevent a similar boot loop.

bain
  • 11,260