Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

[SOLVED] efi stub kernel loading problem

Ask for help with issues regarding the Installations of the Debian O/S.
Message
Author
Bolo
Posts: 22
Joined: 2018-06-20 19:02

[SOLVED] efi stub kernel loading problem

#1 Post by Bolo »

Hello everyone.
I am trying to set 'efi stub' loading mode according to 'https://wiki.debian.org/EFIStub' however when I try to run the efibootmgr command it returns could not prepare Boot variable: no such file or directory.
Any advise?

Thanks in advance.
Last edited by Bolo on 2018-06-23 09:42, edited 1 time in total.

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 133 times

Re: efi stub kernel loading problem

#2 Post by Head_on_a_Stick »

You need to be booted in UEFI mode to make new NVRAM boot entries with efibootmgr.
deadbang

Bolo
Posts: 22
Joined: 2018-06-20 19:02

Re: efi stub kernel loading problem

#3 Post by Bolo »

Head_on_a_Stick - thanks for reply
I am booted in UEFI mode I checked it with command "mount -t efivarfs efivarfs /sys/firmware/efi/efivars" and this returns that is already mounted or efivar -l = where are a listings.
I am trying to install debian with minimal install on nvme disk - is this matters? What is strange - after I did new efibootmgr entries when I run efibootmgr I can see these entries but in the BIOS there is no any.
My partitions are /dev/nvme0n1p1 /dev/nvme0n1p2 and so on.

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 133 times

Re: efi stub kernel loading problem

#4 Post by Head_on_a_Stick »

Bolo wrote:after I did new efibootmgr entries when I run efibootmgr I can see these entries but in the BIOS there is no any
Please post the exact command that you used and also the full output of

Code: Select all

# efibootmgr -v
Some motherboards are reluctant to accept new NVRAM entries, or "forget" them easily, it is tricky to use plain EFI_STUB booting with such hardware.
deadbang

Bolo
Posts: 22
Joined: 2018-06-20 19:02

Re: efi stub kernel loading problem

#5 Post by Bolo »

When I run:

Code: Select all

 export UUID=$(blkid -s UUID -o value /dev/nvme0n1p2)
efibootmgr -c -g -L "Debian (EFI stub)" -l '\EFI\debian\vmlinuz' -u "root=UUID=$UUID ro quiet rootfstype=ext4 add_efi_memmap initrd=\\EFI\\debian\\initrd.img" 
I have recieved listing saying "could not prepare Boot variable: no such file or directory".

Then I tried run:

Code: Select all

efibootmgr -c -d /dev/nvme0n1p2 -p 1 -L Debian (EFI stub) -l \EFI\debian\vmlinuz.efi
and the efibootmgr -v output is:

Code: Select all

BootCurrent: 0000
Timeout: 1 seconds
BootOrder: 0009,0008,0006,0001,0005,0000,0007,0003,0002,0004
Boot0000* debian	HD(1,GPT,d1fb6ae7-19f5-4ad4-9833-5b7b438ca6c1,0x800,0x144000)/File(\EFI\debian\grubx64.efi)
Boot0001* Linux Boot Manager	HD(1,GPT,d1fb6ae7-19f5-4ad4-9833-5b7b438ca6c1,0x800,0x144000)/File(\EFI\systemd\systemd-bootx64.efi)
Boot0002* Debian (EFI stub)	VenHw(99e275e7-75a0-4b37-a2e6-c5385e6c00cb)
Boot0003* Debian (EFI stub)	VenHw(99e275e7-75a0-4b37-a2e6-c5385e6c00cb)
Boot0004* DEB	VenHw(99e275e7-75a0-4b37-a2e6-c5385e6c00cb)
Boot0005* UEFI OS	HD(2,GPT,30cc2ef6-6813-4880-a61e-74b7894f2def,0xfa000,0x32000)/File(\EFI\BOOT\BOOTX64.EFI)..BO
Boot0006* Windows Boot Manager	HD(2,GPT,30cc2ef6-6813-4880-a61e-74b7894f2def,0xfa000,0x32000)/File(\EFI\Microsoft\Boot\bootmgfw.efi)WINDOWS.........x...B.C.D.O.B.J.E.C.T.=.{.9.d.e.a.8.6.2.c.-.5.c.d.d.-.4.e.7.0.-.a.c.c.1.-.f.3.2.b.3.4.4.d.4.7.9.5.}...r................
Boot0007* UEFI: Generic Flash Disk PMAP	PciRoot(0x0)/Pci(0x14,0x0)/USB(9,0)/USB(3,0)..BO
Boot0008* Debian (EFI stub)	HD(1,0,00000000000000000000000000000000,0x0,0x0)/File(\EFI\debian\vmlinuz.efi)
Boot0009* Debian (EFI stub)	HD(1,0,00000000000000000000000000000000,0x0,0x0)/File(\EFI\debian\vmlinuz.efi)echo


User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 133 times

Re: efi stub kernel loading problem

#6 Post by Head_on_a_Stick »

Try

Code: Select all

# efibootmgr -c -d /dev/nvme0n1p2 -p 1 -L 'Debian (EFI_STUB)' -l '/EFI/debian/vmlinuz' -u 'root=UUID=$uuid ro quiet rootfstype=ext4 add_efi_memmap initrd=/EFI/debian/initrd.img'
But be sure to replace $uuid with the actual UUID of the root partition.

It may also be worth checking the EFI system partition for /EFI/debian/{vmlinuz,initrd.img}, just in case.

You may want to remove your abortive earlier attempts with

Code: Select all

# efibootmgr -b xxxx -B
and replace xxxx with the bootnumber of the entry you want removed.
deadbang

Bolo
Posts: 22
Joined: 2018-06-20 19:02

Re: efi stub kernel loading problem

#7 Post by Bolo »

Thank you Head_on_a_Stick.
I will do so and tomorrow let you know the outcome.

Bolo
Posts: 22
Joined: 2018-06-20 19:02

Re: efi stub kernel loading problem

#8 Post by Bolo »

I did as you advised and this returns:

Code: Select all

GUID Partition Table Header signature is wrong: 0 != 5452415020494645
GUID Partition Table Header signature is wrong: 0 != 5452415020494645
GUID Partition Table Header signature is wrong: 0 != 5452415020494645
GUID Partition Table Header signature is wrong: 0 != 5452415020494645
GUID Partition Table Header signature is wrong: 0 != 5452415020494645
GUID Partition Table Header signature is wrong: 0 != 5452415020494645
I can see it when I run efibootmgr but in UEFI/BIOS there is no entry.

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 133 times

Re: efi stub kernel loading problem

#9 Post by Head_on_a_Stick »

Please post the full output of

Code: Select all

# parted --list
^ That command can be run from a "live" distribution.

I will be afk for ~8 hrs.
deadbang

milomak
Posts: 2168
Joined: 2009-06-09 22:20
Been thanked: 2 times

Re: efi stub kernel loading problem

#10 Post by milomak »

Bolo wrote:Hello everyone.
I am trying to set 'efi stub' loading mode according to 'https://wiki.debian.org/EFIStub' however when I try to run the efibootmgr command it returns could not prepare Boot variable: no such file or directory.
Any advise?

Thanks in advance.
so i run sid both on an imac (external hdd) and also on a win10 laptop (partitioned drive)

i didn't go this route on either

iirc i created the vfat boot partition and from there it was all good
Desktop: A320M-A PRO MAX, AMD Ryzen 5 3600, GALAX GeForce RTX™ 2060 Super EX (1-Click OC) - Sid, Win10, Arch Linux, Gentoo, Solus
Laptop: hp 250 G8 i3 11th Gen - Sid
Kodi: AMD Athlon 5150 APU w/Radeon HD 8400 - Sid

Bolo
Posts: 22
Joined: 2018-06-20 19:02

Re: efi stub kernel loading problem

#11 Post by Bolo »

@milomak - thanks for reply.
During the installation I created the boot partition 680 MB and I choosed a format option as ESP partition. Maybe before installation I should have formated this partition using gparted as a fat32 and then put the flag of esp on it?
However as far as I remember I tried to do so and then Debian installer would not be able to recognized this partition unless I erased this and then create this partition from the begining.
Last edited by Bolo on 2018-06-21 05:19, edited 2 times in total.

Bolo
Posts: 22
Joined: 2018-06-20 19:02

Re: efi stub kernel loading problem

#12 Post by Bolo »

@Head_on_a_Stick,
Currently I am at work and I will be able to investigate as you advise after next 10 hours. I will let you know the outcome your code.

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: efi stub kernel loading problem

#13 Post by p.H »

Bolo wrote:efibootmgr -c -d /dev/nvme0n1p2 -p 1 -L Debian (EFI stub) -l \EFI\debian\vmlinuz.efi
- The drive containing the EFI files must be specified with -d (--disk) if different from /dev/sda.
/dev/nvme0n1p2 seems to be a partition. The drive is /dev/nvme0n1.

- Quotes missing around the label string.

- Kernel parameters missing. Even if you can get this entry to boot, without the proper parameters all you will get is a kernel panic due to the inability to mount a root filesystem.
Bolo wrote:GUID Partition Table Header signature is wrong: 0 != 5452415020494645
I have seen this message when specifying a disk with a DOS/MBR partition table. It seems bogus and harmless (unless the boot disk is GPT and you get this message because you specified the wrong disk).

Bolo
Posts: 22
Joined: 2018-06-20 19:02

Re: efi stub kernel loading problem

#14 Post by Bolo »

Hello Guys,
here is the output of the command parted --list

Code: Select all

Model: ATA Corsair Force LS (scsi)
Disk /dev/sda: 240GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system  Name                          Flags
 1      1049kB  524MB   523MB   ntfs         Basic data partition          hidden, diag
 2      524MB   629MB   105MB   fat32        EFI system partition          boot, esp
 3      629MB   646MB   16,8MB               Microsoft reserved partition  msftres
 4      646MB   62,9GB  62,3GB  ntfs         Basic data partition          msftdata
 5      62,9GB  199GB   136GB                Basic data partition          msftdata
 6      199GB   240GB   40,8GB               Basic data partition          msftdata


Model: Generic Flash Disk (scsi)
Disk /dev/sdb: 4173MB
Sector size (logical/physical): 512B/512B
Partition Table: loop
Disk Flags: 

Number  Start  End     Size    File system  Flags
 1      0,00B  4173MB  4173MB  fat32


Model: Unknown (unknown)
Disk /dev/nvme0n1: 256GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system     Name      Flags
 1      1049kB  681MB   679MB   fat32                     boot, esp
 2      681MB   41,7GB  41,0GB  ext4            System
 3      41,7GB  47,7GB  6000MB  linux-swap(v1)
 4      47,7GB  256GB   208GB   ext4            Komputer
What is more grub is launching the system properly but I would like to remove grub and use only efi stub mode.

Bolo
Posts: 22
Joined: 2018-06-20 19:02

Re: efi stub kernel loading problem

#15 Post by Bolo »

@p.H - thanks for reply.
As I have been advised I wiped out these abortive entries as well this one which you quoted and this is not the case anymore. I mean that was my ..... yes abortive try and lets forget about it :)

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 133 times

Re: efi stub kernel loading problem

#16 Post by Head_on_a_Stick »

p.H wrote:- The drive containing the EFI files must be specified with -d (--disk) if different from /dev/sda.
/dev/nvme0n1p2 seems to be a partition. The drive is /dev/nvme0n1.
Ah yes, of course, thanks!

@Bolo, my posted command was slightly wrong, here is a corrected version:

Code: Select all

# efibootmgr -c -d /dev/nvme0n1 -p 1 -L 'Debian (EFI_STUB)' -l '/EFI/debian/vmlinuz' -u 'root=UUID=$uuid ro quiet rootfstype=ext4 add_efi_memmap initrd=/EFI/debian/initrd.img'
deadbang

Bolo
Posts: 22
Joined: 2018-06-20 19:02

Re: efi stub kernel loading problem

#17 Post by Bolo »

Nope it does not work but this time the listing is like this:

Code: Select all



******************************************************
Warning! This MBR disk does not have a unique signature.
If this is not the first disk found by EFI, you may not be able
to boot from it without a unique signature.
Run efibootmgr with the -w flag to write a unique signature
to the disk.
******************************************************



******************************************************
Warning! This MBR disk does not have a unique signature.
If this is not the first disk found by EFI, you may not be able
to boot from it without a unique signature.
Run efibootmgr with the -w flag to write a unique signature
to the disk.
******************************************************



******************************************************
Warning! This MBR disk does not have a unique signature.
If this is not the first disk found by EFI, you may not be able
to boot from it without a unique signature.
Run efibootmgr with the -w flag to write a unique signature
to the disk.
******************************************************

BootCurrent: 0000
Timeout: 1 seconds
BootOrder: 0001,0006,0000,0005,0007
Boot0000* debian
Boot0005* UEFI OS
Boot0006* Windows Boot Manager
Boot0007* UEFI: Generic Flash Disk PMAP
Boot0001* Debian(EFI_STUB)


Bolo
Posts: 22
Joined: 2018-06-20 19:02

Re: efi stub kernel loading problem

#18 Post by Bolo »

Maybe there is another way to boot kernel without grub? bootctl? If there is no way to load kernel directly from nvme disk.

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 133 times

Re: efi stub kernel loading problem

#19 Post by Head_on_a_Stick »

Bolo wrote:

Code: Select all

Run efibootmgr with the -w flag to write a unique signature
^ Try this ;)
Bolo wrote:bootctl?
I've used gummiboot with jessie and it worked well, stretch seems to have bootctl included with systemd so you could give it a try.

What do you have against GRUB anyway?
deadbang

Bolo
Posts: 22
Joined: 2018-06-20 19:02

Re: efi stub kernel loading problem

#20 Post by Bolo »

Thanks Head_on_a_Stick,
Where I should placed this -w flag? I was trying to use bootctl following instruction from arch wiki but unssuccefuly I mean the entry was made properly but when I lauch it while booting the system this did not worked - the system did not started. It looked like it did not pick up the right kernel launcher.
Grub sometimes causes troubles and from time to time it needs to be maintained. I would like to install as minimal system as it could be and use refind to manage of switching between Debian and Windows. I would like to focus on learning the Linux itself and do not bother on grub.

Post Reply