The officially official Devuan Forum!

You are not logged in.

#1 2016-12-01 13:12:04

edbarx
Member
Registered: 2016-12-01
Posts: 20  

How to boot GRUB with HP Probook 4540s

What is required:

  • To use GPT, EFI boot mode must be used. Legacy Boot mode does not seem to support the use of GPT formatted disks. Please, note I haven't tried an MBR formatted disk as I prefer the advantages of GPT over MBR

  • An EFI System Partition must be present if GPT is used.

  • The laptop's EFI firmware assumes the first stage of the bootloader is placed in the EFI system partition under:

    /EFI/Microsoft/Boot
  • The name of the first stage must be bootmgfw.efi

  • During setup grub-efi creates a primary bootloader with name grubx64.efi and places it under /boot/EFI/debian or /boot/EFI/devuan. The EFI System Partition must be mounted on /boot/efi.

  • So to make this laptop boot grub-efi in EFI mode with Secure boot disabled it is necessary to have an EFI System Partition with boot flags boot and efi.

  • The installation of Devuan or Debian should have the EFI system partition mounted on /boot/efi when grub-efi is setting itself up.

The Howto:
Boot the computer with gparted disk to create a new 200 MB FAT32 formatted partition to serve as an EFI System Partition. Also remember to use the boot and esp flags for the partition.

During the installation of Devuan or Debian make sure grub-efi is installed and setup. This should result in the primary bootloader being saved under /boot/EFI/devuan or /boot/EFI/debian. An EFI System Partition must exist for grub-efi to properly setup itself.

Search the EFI System Partition for a file named grubx64.efi under /boot/EFI/devuan or /boot/EFI/debian assuming the EFI System Partition is mounted on /boot/efi. 'efi' is a directory under /boot. Make a backup of grubx64.efi and rename grubx64.efi to bootmgfw.efi. Finally, move bootmgfw.efi to /boot/EFI/Microsoft/Boot/. You will need to create any missing directories.

Enjoy!

Last edited by edbarx (2016-12-01 18:42:11)

Offline

#2 2026-01-08 17:28:34

brozkeff
Member
Registered: 2026-01-08
Posts: 1  

Re: How to boot GRUB with HP Probook 4540s

This is a known bug with many other HP laptops, particularly those older with very buggy UEFI implementation (namely HP Elitebook 8460p, 8470p, 2170p, 2560p, 2570p...), basically all the Sandy Bridge + Ivy Bridge era business laptops seem to be affected.

Not just it ignores EFI files elsewhere but in the one single expected location of Windows bootloader, it also fails to have any records set by `efibootmgr` tool. Normally Linux sets there its record such as ubuntu or debian and sets it as default in the BootOrder. Try setting anything there on such laptops, and even if you succeed to set anything, on boot it is completely ignored.

There is one other way how to actually boot not from the filepath of the Windows EFI file, but via "Customized Boot" option. You need to know first the exact location of the EFI file you want to boot on the ESP partition and enter it blindly in HP UEFI interface in Customized Boot using backslashes, not forward slashes, and set Customized Boot as the default boot option from within HP UEFI GUI.

Example when Secure boot on for Ubuntu: EFI\ubuntu\shimx64.efi

or Debian/Devuan:EFI\devuan\shimx64.efi

When not using Secure Boot: you can replace shimx64.efi for grubx64.efi.

Other documentation of these quirks: https://askubuntu.com/questions/554690/ … omatically

Offline

#3 2026-01-08 18:07:57

RedGreen925
Member
Registered: 2024-12-07
Posts: 262  

Re: How to boot GRUB with HP Probook 4540s

In addition to the HP piece of garbage implementation of the EFI specification the default location and file that all others look for when booting is /boot/efi/EFI/BOOT/BOOTX64.EFI for a 64bit boot or a 32 named file for 32 bit boot. That file is a copy of the linux or windows .efi file used to boot with in their respective directories in the EFI directory in the EFI partition on the disk.

enter it blindly in HP UEFI interface in Customized Boot using backslashes, not forward slashes

Of course you have to it is a fat32 file system it does not use forward slashes for a directory seperator.

Offline

Board footer