You are not logged in.

#1 2017-04-02 14:29:04

sevaho
Member
Registered: 2016-12-01
Posts: 24

[SOLVED] EFI stub: ERROR: failed to read file. Every time I do a upgrd

Hello,

Every time I do a kernel upgrade and reboot I get the following  error:

EFI stub: ERROR: failed to read file.
Trying to load files to higher address
EFI stub: ERROR: failed to read file.

I have noticed there are other posts about this but I can't manage to find a solution.

I run arch linux 4.10.6-1 now, with systemd-boot (UEFI) on a Lenovo y50-70 I7-4710HQ secureboot is off and arch linux is the only OS on the device, no dual boots I did a clean install. I have tried to run other kernels, zen-kernel and kernel-lts but same error after upgrade so I don't think this is a kernel problem.

Disk layout:

NAME   FSTYPE LABEL UUID                                 MOUNTPOINT
sda
├─sda1 vfat         6305-539C                            /boot
├─sda2 swap         a5714c8e-dcd1-4b39-bb9c-21165bcfc033 [SWAP]
└─sda3 btrfs        02fd2f46-d5b1-4dc9-bdc8-9f21b7492cb1 /

I fix this error everytime by arch-chrooting with a live-cd and do the following:

cd /var/cache/pacman/pkg
pacman -U <kernel>
pacman -U <kernel headers>
mkinitcpio -p linux
bootctl update
sync
umount <devices>
reboot

I tried to run fsck on the boot partition but it didn't help even it found a dirty bit.

Anyone know what exactly the problem is? A systemd-boot flaw?

Last edited by sevaho (2017-04-15 08:52:32)

Offline

#2 2017-04-03 12:24:18

mrunion
Member
From: Jonesborough, TN
Registered: 2007-01-26
Posts: 1,938
Website

Re: [SOLVED] EFI stub: ERROR: failed to read file. Every time I do a upgrd

It sounds like you do not have the proper /boot mounted during a Kernel upgrade. Show us your fstab, or better yet search the forums for something about "/boot not mounted EFI" and you will find info about making sure the proper /boot is mounted.


Matt

"It is very difficult to educate the educated."

Offline

#3 2017-04-05 17:52:53

sevaho
Member
Registered: 2016-12-01
Posts: 24

Re: [SOLVED] EFI stub: ERROR: failed to read file. Every time I do a upgrd

My fstab:

# /dev/sda3
UUID=02fd2f46-d5b1-4dc9-bdc8-9f21b7492cb1       /               btrfs           rw,relatime,space_cache,subvolid=5,subvol=/     0 0

# /dev/sda1
UUID=6305-539C          /boot           vfat            rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro    0 2

# /dev/sda2
UUID=a5714c8e-dcd1-4b39-bb9c-21165bcfc033       none            swap            defaults        0 0

Offline

#4 2017-04-05 18:38:19

Blasphemist
Member
From: Colorado
Registered: 2013-01-17
Posts: 160

Re: [SOLVED] EFI stub: ERROR: failed to read file. Every time I do a upgrd

Did your path on the install command for systemd-boot match your mount point for the ESP? The command shown in the wiki is: bootctl --path=esp install. Did you use /dev/sda1 when you ran the command? If not, do that.

The next thing I'd do is try not using systemd-boot. Try using the default EFISTUB capability and have UEFI launch the Arch kernel directly. The efibootmgr command to do that is shown in the wiki but ask if you have questions.

Since you used /boot as the mount point for the ESP the kernel resides on the ESP. That should eliminate any potential that systemd-boot can't access the kernel on another partition. Once the kernel is loading/loaded it does depend on files in the root partition but I don't think that is your issue.


Simple and Open

Offline

#5 2017-04-09 16:38:27

sevaho
Member
Registered: 2016-12-01
Posts: 24

Re: [SOLVED] EFI stub: ERROR: failed to read file. Every time I do a upgrd

I really don't know what the problem is, I did the exact same thing (installation + configuration of arch linux) on my little laptop asus E200HA and I never got any trouble with it. My guess it's a hardware issue, I have also troubles with drivers on my Lenovo laptop. For example I can run Minecraft out of the box on the asus but can't manage to run it on the Lenovo.

I am trying to configure EFISTUB but I fail.

So efi/boot/bootx64.efi is mounted on /boot on /dev/sda1.

I did the next command to configure EFISTUB:

efibootmgr -c -d /dev/sda -p 2 -L "Arch Linux EFISTUB" -l "\efi\boot\bootx64.efi"

But still getting the same error and I select the label in the boot manager.


Greetings

Offline

#6 2017-04-09 20:40:05

olegabrielz
Member
From: Norway
Registered: 2015-12-23
Posts: 255

Re: [SOLVED] EFI stub: ERROR: failed to read file. Every time I do a upgrd

That efibootmgr command line smells kind of fishy. The wiki says:
https://wiki.archlinux.org/index.php/EFISTUB#efibootmgr

You should also install microcode. And then append it so you get two initrd= options (microcode first), like this:

# efibootmgr -d /dev/sda -p 1 -c -L "Arch Linux EFISTUB" -l /vmlinuz-linux -u "root=/dev/sda3 rw initrd=/intel-ucode.img initrd=/initramfs-linux.img"

(I did edit the line to fit your partition scheme)

Edit: Typo

Last edited by olegabrielz (2017-04-09 21:21:50)


Be aware of my Newbie Powers

Offline

#7 2017-04-13 14:27:02

mrunion
Member
From: Jonesborough, TN
Registered: 2007-01-26
Posts: 1,938
Website

Re: [SOLVED] EFI stub: ERROR: failed to read file. Every time I do a upgrd

Are those supposed to be BACKSLASHES in the efibootmgr command that was issued, @sevaho?


Matt

"It is very difficult to educate the educated."

Offline

#8 2017-04-15 08:49:36

sevaho
Member
Registered: 2016-12-01
Posts: 24

Re: [SOLVED] EFI stub: ERROR: failed to read file. Every time I do a upgrd

No, I found it on the Gentoo wiki, I shouldn't have looked there.

Thanks @olegabrielz for the command it worked like a charm.

Offline

#9 2017-04-15 09:30:33

olegabrielz
Member
From: Norway
Registered: 2015-12-23
Posts: 255

Re: [SOLVED] EFI stub: ERROR: failed to read file. Every time I do a upgrd

The lesson learned: Use the proper documentation! You should also be aware of that using the root=/dev/sdxY parameter can be a problem in some cases (adding disks or thumb drives may change device order upon boot). It is better to use PARTUUID:

root=PARTUUID=<PARTUUID>

Where you replace <PARTUUID> with your root PARTUUID. To obtain it just use:

sudo blkid -s PARTUUID -o value /dev/sdxY

Edit: Added: upon boot

Last edited by olegabrielz (2017-04-15 09:33:49)


Be aware of my Newbie Powers

Offline

#10 2018-09-07 21:35:26

max_overdrive
Member
Registered: 2018-05-09
Posts: 1

Re: [SOLVED] EFI stub: ERROR: failed to read file. Every time I do a upgrd

Just found out that `EFI stub: ERROR: failed to read file.` (at least in my case) actually refers specifically to `initrd` (which had been nuked by an unplanned shutdown during updates)
someone changed the message to 'generalize' the code at some point.
https://github.com/torvalds/linux/commi … 363034R475

Offline

#11 2018-09-07 22:52:29

circleface
Member
Registered: 2012-05-26
Posts: 639

Re: [SOLVED] EFI stub: ERROR: failed to read file. Every time I do a upgrd

max_overdrive, thank you for your contribution.  Please note that this thread is over a year old so please do not necrobump it.

Offline

#12 2018-09-07 23:09:40

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 13,718
Website

Re: [SOLVED] EFI stub: ERROR: failed to read file. Every time I do a upgrd

As noted, necrobumping is frowned upon. Please make sure you familiarise yourself with the entire Code of Conduct: https://wiki.archlinux.org/index.php/Code_of_conduct

Closing.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

Board footer

Powered by FluxBB