You are not logged in.

#1 2023-07-05 21:26:15

dreieck
Member
Registered: 2012-10-08
Posts: 56

[solved] BIOS does not detect any EFI boot loader, need use EFI shell

Ahoj,

On my [GPD MicroPC](https://wiki.archlinux.org/title/GPD_MicroPC) I have completely set up a new system, and now the BIOS does not detect any UEFI bootloader. 
It already had some UEFI-related quirks before.

Here the details:

I have partitioned the disk with a GPT partition table with the following layout (`gdisk -l /dev/sda`):

GPT fdisk (gdisk) version 1.0.9.1

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.
Disk /dev/sda: 250069680 sectors, 119.2 GiB
Model: BIWIN SSD       
Sector size (logical/physical): 512/512 bytes
Disk identifier (GUID): E781F00B-9D3D-4F75-B1BA-752A1A40D42D
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 250069646
Partitions will be aligned on 2048-sector boundaries
Total free space is 17005 sectors (8.3 MiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1           16384         2097151   1016.0 MiB  EF00  EFI system partition
   2         2097152       233291775   110.2 GiB   8E00  Linux LVM
   3       233291776       250068991   8.0 GiB     8E00  Linux LVM

The first partition, `sda1`, is the EFI system partition.

Details of `sda1` displayed with `gdisk`s `i` command:

Partition GUID code: C12A7328-F81F-11D2-BA4B-00A0C93EC93B (EFI system partition)
Partition unique GUID: B9D161C0-D5D4-4BFD-8630-FF473929B563
First sector: 16384 (at 8.0 MiB)
Last sector: 2097151 (at 1024.0 MiB)
Partition size: 2080768 sectors (1016.0 MiB)
Attribute flags: 0000000000000000
Partition name: 'EFI system partition'

The filesystem on `sda1` is FAT16 (I had it with FAT32 also, in both cases the BIOS does not find UEFI bootloaders there) and has the label `ESP`.

Within the `sda1` partition, I have (besides the Linux kernel and initial ramdisk and GRUB's files) the directory structure and files

/efi/
  +- Boot/
  |   `- bootx64.efi
  +- efi/
  |   `- grub/
  |       `- grubx64.efi
  +- grub/
  |   `- grubx64.efi
  +- refind/
  |   +- icons/
  |   |   `- [...]
  |   +- keys/
  |   +- boot.csv
  |   +- refind.conf
  |   `- refind_x64.efi
  `- tools/
/g.efi

The additional `efi/efi/grub/grubx64.efi` I created only later to try if it helps to solve the problem (it did not help), the `/g.efi` is a copy of `grubx64.efi` to more easily manually boot via the BIOS` EFI shell.

The symptoms are now the following:

* The BIOS does not offer me any operating system on harddisk to boot. It only allows me to drop into the EFI shell. From there I can boot by typing `fs0:g` (`fs0` for the first file system the EFI has recognised, that is the `sda1` partition, and then loading the file `g.efi`, which I have created as a copy of `grubx64.efi` so that I am able to boot without typing much in the EFI shell).
* When I use the command line [tool `efibootmgr`](https://github.com/rhboot/efibootmgr) to modify the UEFI's boot entries, it fails with `Could not prepare Boot variable: No space left on device`. But I am not sure which device `efibootmgr` thinks is full; `sda1` has plenty of space and is mounted writeable; it seems to be something directly by the BIOS? -- The same message appears when I want to reorder Bootnums, but the reordering still is carried out.

With the old HDD, there was already an EFI boot related quirk, I don't know if it is related: 
Whenever the system was forced power-off (by holding the power buttons several seconds), it also first only could drop into the EFI shell. After a reboot, the Windows Boot Manager (windows `.efi` boot binary) was set as only boot option. I then had to manually select GRUB in the BIOS and put it as default, but at least it was possible. Now I don't have any Windows left.

Anyone an idea if I got something wrong, or if the MicroPC needs some very special treatment to be able to boot an EFI binary, and if so what is needed?

Regards!

Last edited by dreieck (2023-07-06 07:16:43)

Offline

#2 2023-07-06 04:59:25

-thc
Member
Registered: 2017-03-15
Posts: 511

Re: [solved] BIOS does not detect any EFI boot loader, need use EFI shell

dreieck wrote:

When I use the command line [tool `efibootmgr`](https://github.com/rhboot/efibootmgr) to modify the UEFI's boot entries, it fails with `Could not prepare Boot variable: No space left on device`

This should be the EFI NVRAM storage on your mainboard.

Please use

efibootmgr -v

to view this storage.

Offline

#3 2023-07-06 07:15:39

dreieck
Member
Registered: 2012-10-08
Posts: 56

Re: [solved] BIOS does not detect any EFI boot loader, need use EFI shell

-thc wrote:
dreieck wrote:

When I use the command line [tool `efibootmgr`](https://github.com/rhboot/efibootmgr) to modify the UEFI's boot entries, it fails with `Could not prepare Boot variable: No space left on device`

This should be the EFI NVRAM storage on your mainboard.

Please use

efibootmgr -v

to view this storage.

Ah, thanks. There were old entries left over:

Boot0001  Could not parse device path: No such file or directory
error trace:
Boot0002  Could not parse device path: No such file or directory
error trace:
[...]

After I deleted them, I could add some new ones.

Regards!

Offline

Board footer

Powered by FluxBB