You are not logged in.

#1 2021-05-31 15:42:25

AlexZab
Member
Registered: 2021-05-23
Posts: 6

EFI stub: Failed to read file

Hello everyone. I am a newbie in archlinux, so probably I do not understand some important things about this wonderful but complex system
I tried to update the system when this problem appeared. Maybe I do something wrong when updating my system?
I ran these commands:

sudo pacman -Syy
sudo pacman -Syu

When update was done I ran reboot command. But archlinux does not boot anymore. It writes the next message when I'm trying to launch the system:

EFI stub: ERROR: Failed to read file
EFI stub: ERROR: Failed to load initrd!
EFI stub: ERROR: efi_main() failed!

Failed to execute Arch Linux (\vmlinuz-linux): invalid Parameter

Then I launched my system using USB with ISO and arch-chroot and tried to do this stuff:

pacman -Sc
pacman -Syu

But this problem still appears, and I still can not launch the system
There is

cat /etc/fstab

output:

# Static information about the filesystems.
# See fstab(5) for details.

# <file system> <dir> <type> <options> <dump> <pass>

tmpfs /tmp tmpfs defaults,noatime,mode=1777 0 0
# /dev/nvme0n1p2
UUID=b47e43a9-448b-4237-ab63-b298ef6d70d7    /        btrfs        rw,realtime,ssd,space_cache,subvoid=5,subvol=/ 0 0

# /dev/nvme0n1p1
UUID=AAZB-30C1    /boot       vfat        rw,realtime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-r0    0 2

Hope this information is useful

Thanks in advance!

Offline

#2 2021-05-31 21:51:15

feinedsquirrel
Member
Registered: 2020-12-11
Posts: 33

Re: EFI stub: Failed to read file

What boot manager are you using?
Also, what are the contents of your efi system partition?

Offline

#3 2021-06-01 13:22:37

AlexZab
Member
Registered: 2021-05-23
Posts: 6

Re: EFI stub: Failed to read file

My boot manager is systemd-boot, by default.
I'm so sorry, but I don't know how to get the contents of efi system partition
How can I check it? If you talk about content of /boot/efi, then my /boot is empty.

output of parted /dev/nvme0n1p2 print:

Model: NVMe Device (nvme)
Sector size (logical/physical): 512B/512B
Partition Table: loop
Disk Flags:

Number  Start    End         Size         File system   Flags
1                0.00B  537MB   537MB   fat32

output of gdisk -l /dev/nvme0n1p1:

GPT fdisk (gdisk) version 1.0.7

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


****************************************************************
Found invalid GPT and valid MBR; converting MBR to GPT format
in memory
****************************************************************

Disk /dev/nvme0n1p1: 1048576 sectors, 512.0 MiB
Sector size (logical/physical): 512/512 bytes
Disk identifier (GUID): DA392377-8D0B-4566-B8F9-6B6E7279D93D
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 1048542
Partitions will be aligned on 2048-sector boundaries
 Total free space is 1048509 sectors (512.0 MiB)

Number Start (sector)    End (sector)   Size      Code   Name

Sorry again if this is not what you asked for

Offline

#4 2021-06-02 11:43:16

captain_sensible
Member
Registered: 2021-05-29
Posts: 46

Re: EFI stub: Failed to read file

I'm so sorry, but I don't know how to get the contents of efi system partition

you can use efibootmgr; if its nit installed you can get it from repo via pacman

eg

[andrew@darkstar:~][127]$ efibootmgr -v     

BootCurrent: 0000
Timeout: 0 seconds
BootOrder: 0000,0001,9999
Boot0000* boot	HD(1,GPT,192a9aa1-9848-4329-8171-9253ffc0f920,0x800,0x32000)/File(\EFI\boot\grubx64.efi)
Boot0001* Internal Hard Disk	PciRoot(0x0)/Pci(0x11,0x0)/Sata(1,65535,0)/HD(1,GPT,192a9aa1-9848-4329-8171-9253ffc0f920,0x800,0x32000)..BO

Last edited by captain_sensible (2021-06-02 11:44:31)

Offline

#5 2021-06-02 16:05:16

AlexZab
Member
Registered: 2021-05-23
Posts: 6

Re: EFI stub: Failed to read file

Oh, thanks
Output of efibootmgr -v:

BootCurrent: 0001
Timeout: 0 seconds
BootOrder: 0000, 2001, 2002, 2003
Boot0000* EFI Hard Drive (WDC PC SN730 SDBPNTY-512G-1027)        PciRoot(0x0)/Pci(0x2,0x3)/Pci(0x0,0x0)/NVMe(0x1,00-1B-44-8B-46-5C-73-DC)/HD(1,GPT,5daa9e51-7eec-4352-88d8-e1ff366wb47f,0x800,0x100000)RC
Boot0001* EFI USB Device (SanDisk) UsbWwid(781,55a1,0,4C53000121110711117)/HD(2,GPT,31323032-3430-4130-b132-303731343034,0x156800,0x20800)RC
Boot2001* EFI USB Device        RC
Boot2002* EFI DVD/CDROM        RC
Boot2003* EFI Network        RC

Last edited by AlexZab (2021-06-02 16:11:20)

Offline

#6 2021-06-02 17:01:40

feinedsquirrel
Member
Registered: 2020-12-11
Posts: 33

Re: EFI stub: Failed to read file

captain_sensible does efibootmgr understand legacy boot? AlexZab doesn't have a GPT, which strongly suggests he is booting in "legacy" BIOS boot mode, i.e. no efi boot.

AlexZab, are there any files in the "/sys/firmware/efi/efivars" directory? If it is empty, it is very likely you need to use Syslinux, because systemd-boot does not support BIOS boot. See the table here.

Now, you'll have other problems moving forward if you saved (command "w") in gdisk before exiting, because gdisk default behavior is to convert to an MBR based disk to a GPT based disk when you run it. So as long as you didn't save, you can "probably" move forward, and attempt to set up syslinux, and get rid of systemd-boot.

I would suggest, however, that if your system supports efi boot, to start from scratch. Wipe your drive, convert it to GPT with gdisk, create your EFI System Partition (ESP) and any other partitions you need in gdisk, then install Arch. Properly configuring systemd-boot to use your ESP.

Offline

#7 2021-06-02 18:59:32

captain_sensible
Member
Registered: 2021-05-29
Posts: 46

Re: EFI stub: Failed to read file

well  feinedsquirrel there seems to be mixed messages if you look at output of efibootmgr :

Boot0000* EFI Hard Drive (WDC PC SN730 SDBPNTY-512G-1027)        PciRoot(0x0)/Pci(0x2,0x3)/Pci(0x0,0x0)/NVMe(0x1,00-1B-44-8B-46-5C-73-DC)/HD(1,GPT,5daa9e51-7eec-4352-88d8-e1ff366wb47f,0x800,0x100000)RC

  there is GPT in that output ;but i agree withb your thinking re:  "/sys/firmware/efi/efivars"  also dmidecode can help to confirm ; dmidecode its in repo

eg 
andrew@darkstar:~][127]$ sudo pacman -Ss dmidecode               (06-02 19:40)
extra/dmidecode 3.3-1
    Desktop Management Interface table related utilities

output(abstracgt)  on my PC


[andrew@darkstar:~][1]$  sudo  dmidecode 3.0         
UEFI is supported

So yes lets confirm whether motherboard is uefi; also the more facts and investigation the better. the  efi partition (circa 100mb) its just fat32 so i used gparted to create mine, although i have used gdisk on Slackware  i think where the code was EF00 and other partitions before install.  i'm using grub 2 as bootloaded on mine thats another option. If its a new install i don't see whats wrong with your last paragraph if there's stuff on system that needs rescuing use a liveOS from usb to access it/copy it

I'm a visual person a screenshot of partitions using gParted wouldn't go amiss

Offline

#8 2021-06-02 19:39:47

feinedsquirrel
Member
Registered: 2020-12-11
Posts: 33

Re: EFI stub: Failed to read file

yes, captain_sensible, I agree with you, there is conflicting information. I apologize if I came across as rude, was not trying to be. It's also possible his firmware settings were altered by something, and even if his system supports EFI boot, it is still set to enable (and prefer?) CSM, or, Legacy boot mode.

AlexZab, I forgot to mention what captain_sensible said, about the last paragraph in my previous response. Only follow those instructions if you have a fresh install or have backed up your data off that disk. If you do go this route. Run the commands captain_sensible suggested, and post the output. If your system does support EFI, boot into the firmware settings and check if "CSM", or "Legacy", or "BIOS boot mode" or "MBR" is mentioned anywhere. It might say, for example, something like "enable EFI and Legacy boot". Let us know what you find. Maybe post some pictures somewhere and give us a link. Include a pic of gparted.

Edit:

Also, https://wiki.archlinux.org/title/Instal … _boot_mode

post the output of that.

Last edited by feinedsquirrel (2021-06-03 11:27:32)

Offline

#9 2021-06-04 13:56:23

captain_sensible
Member
Registered: 2021-05-29
Posts: 46

Re: EFI stub: Failed to read file

I apologize if I came across as rude

no your were fine feinedsquirrel

Offline

Board footer

Powered by FluxBB