You are not logged in.

#1 2017-03-30 03:12:45

rarelymore
Member
Registered: 2017-03-30
Posts: 8

[solved] recovering efi boot options

My system is a thinkpad x230.
When installing Arch I opted to skip an intermediate bootloader and use UEFI.
With efibootmgr I set the boot order:

efibootmgr -o XXXX

(with XXXX being the boot entry for Arch as returned by

efibootmgr -v

in my particular case: 0018)

Upon rebooting I am dropped into an emergency shell:

> ERROR: device '{the partition's UUID}' not found. Skipping fsck.
> :: mounting '{the partition's UUID}' on real root
> mount: you must specify the filesystem type
> You are now being dropped into an emergency shell.
> sh: can't access tty: job control turned off
> [rootfs ]#

I am no longer able to boot to anything but the boot entry set by efibootmgr. When I say anything, I mean anything.
It doesn't appear to be possible to boot to an external drive, or via PXE, or a disc, or anything. The only entry shown in the boot list is the sole entry which i set with efibootmgr.

From the emergency shell I have tried quite a few things hoping to be able to run efibootmgr and reset/repair the boot entry list. No luck.

Is there an easy way to revert or restore the previous boot entry list?
Is there any way to revert or restore the previous boot entry list?

Last edited by rarelymore (2017-04-17 12:07:40)

Offline

#2 2017-03-30 04:21:00

Docbroke
Member
From: India
Registered: 2015-06-13
Posts: 1,433

Re: [solved] recovering efi boot options

Boot with archiso, mount required partitions, and revert the changes.

Offline

#3 2017-03-30 05:00:55

rarelymore
Member
Registered: 2017-03-30
Posts: 8

Re: [solved] recovering efi boot options

Hi Docbroke,
Thank you for your comment.
As I mentioned, I am unable to boot anything except for the broken boot entry for arch linux. I have attached two PNG images below which I hope will help clarify the problem I've encountered:
https://drive.google.com/open?id=0B2uW7 … 2hMZ2NWRHM
https://drive.google.com/open?id=0B2uW7 … 3lUTjlKNFk

Offline

#4 2017-03-30 10:14:56

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: [solved] recovering efi boot options

Ahh the joys of uefi.

Since you can't boot anything else I would try loading the setup defaults and see if that brings back at least cd and usb booting back.

An alternative would be to enable the csm module and see if that allows you to boot external media and then you can try to recover the other boot entries.

You probably also want to ask around in the lenovo forums if there is any way to restore factory defaults for the firmware or somehow reinitialize everything.


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#5 2017-03-30 10:38:11

Docbroke
Member
From: India
Registered: 2015-06-13
Posts: 1,433

Re: [solved] recovering efi boot options

What is there in "excluded from boot priority order" ? It looks like you have excluded other devices from boot.
If there is option in your bios settings, try disabling secure boot.

Offline

#6 2017-03-30 13:59:37

rarelymore
Member
Registered: 2017-03-30
Posts: 8

Re: [solved] recovering efi boot options

Hey guys, thanks for the replies.

I have already tried setting the setup defaults in the "BIOS" I use quotes because this laptop has no bios, but does have a CSM legacy module, which I've tried enabling and disabling,
Ordinarily you would see entries in the "excluded from boot priority order", they are missing too. There is absolutely no way that I can find to boot to anything but the UUID defined with efibootmgr.
I imagine that I'm going to have to get it to run in the emergency shell, which is a huge pain because there is no compiler, hardly any kernel modules, no persistence (not a big deal, but a potential pain because I'll need to change default locations for everything), etc etc.
I thought maybe I could compile a portable binary of efibootmgr, but it has dependencies, one of which is efivars, which is not loaded, and which I can't figure out how to load. I thought maybe I could chroot to another Linux installation, but the kernel is different, and it still requires efivars.
I have already tried enabling and disabling any and all potentially related settings in the "BIOS"
I am going to try posting a query over at Lenovo's site. Hopefully there's an easy way to reset, maybe pulling the mobo battery to reset nvram?

Any other suggestions appreciated. I'll update if I figure this out.

Offline

#7 2017-03-30 14:10:28

loqs
Member
Registered: 2014-03-06
Posts: 17,196

Re: [solved] recovering efi boot options

From the emergency shell can you not mount the root filesystem then chroot into it?

Offline

#8 2017-03-30 15:18:36

rarelymore
Member
Registered: 2017-03-30
Posts: 8

Re: [solved] recovering efi boot options

I can mount the root filesystem and chroot into it. However, there is an issue which chrooting, and a message regarding sh and tty, and the host in the shell prompt is "none".
I am not at the unit right now, but I will update with the specific error message in a few hours.

EDIT: the error message I was receiving is not reproducible, which is good i suppose.

Also, I can only mount ext4 partitions, when i try anything else I get an error, and I think that's because of missing kernel modules.

Last edited by rarelymore (2017-03-31 03:47:34)

Offline

#9 2017-03-30 15:40:19

loqs
Member
Registered: 2014-03-06
Posts: 17,196

Re: [solved] recovering efi boot options

Yes you would need to chroot into the root filesystem to access the kernel modules not needed for early boot.
If you can not use arch_chroot (not sure if it is included in the initrd) see Change_root#Using_chroot)

Offline

#10 2017-03-31 07:18:42

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,680
Website

Re: [solved] recovering efi boot options

This may sound crazy but you could try deleting the "Arch Linux" NVRAM entry from your firmware menu.

UEFI firmware should fall back to $ESP/EFI/BOOT/BOOT{X64,IA32}.EFI in the absence of any other NVRAM entries and this is what all UEFI-capable ISO images use to boot.

Offline

#11 2017-03-31 12:49:55

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: [solved] recovering efi boot options

Head_on_a_Stick wrote:

This may sound crazy but you could try deleting the "Arch Linux" NVRAM entry from your firmware menu.

UEFI firmware should fall back to $ESP/EFI/BOOT/BOOT{X64,IA32}.EFI in the absence of any other NVRAM entries and this is what all UEFI-capable ISO images use to boot.

I'm not sure that will work. It should fall back to $ESP/EFI/BOOT/BOOT{X64,IA32}.EFI if there is a generic boot entry to boot from ATA HDD or something similar, in this case there isn't so it will probably see no entries to try to boot from and just do nothing.

On the same lines I guess turning on the CSM module or even configuring the FW to do legacy boot only might fail for the same reason. UEFI is nice but this is something I can't understand why there isn't a way to restore the configuration to sane defaults.


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#12 2017-04-04 20:05:33

goumba
Member
From: New Jersey, USA
Registered: 2017-03-31
Posts: 21
Website

Re: [solved] recovering efi boot options

R00KIE wrote:
Head_on_a_Stick wrote:

This may sound crazy but you could try deleting the "Arch Linux" NVRAM entry from your firmware menu.

UEFI firmware should fall back to $ESP/EFI/BOOT/BOOT{X64,IA32}.EFI in the absence of any other NVRAM entries and this is what all UEFI-capable ISO images use to boot.

I'm not sure that will work. It should fall back to $ESP/EFI/BOOT/BOOT{X64,IA32}.EFI if there is a generic boot entry to boot from ATA HDD or something similar

It *should* work. Lacking any other boot entries, this is what UEFI is supposed to do.

http://www.rodsbooks.com/efi-bootloader … .html#copy

See the last paragraph of the section.

Last edited by goumba (2017-04-04 20:06:02)


FSF Associate Member #12876
"Yeah, well, you know, that's just, like, your opinion, man." - The Dude

Offline

#13 2017-04-04 20:39:17

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: [solved] recovering efi boot options

goumba wrote:

It *should* work. Lacking any other boot entries, this is what UEFI is supposed to do.

http://www.rodsbooks.com/efi-bootloader … .html#copy

See the last paragraph of the section.

Should is the key word here, I believe the OP would be a lot more confident in trying it if the key word was will work, which you don't know, the author of the page you link to probably didn't even think of a case such as this one and I would be inclined to think it will fail, as I have pointed previously. Would be nice to be proven wrong though, it would mean that there is a way to recover from mistakes like this.

In theory uefi is great, in practice it is fragile and full of bugs and terrible implementations, the problem described here a very good example, there is no way to restore the boot entries to sane/factory defaults, even if that would mean custom entries would be erased.


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#14 2017-04-04 22:58:35

goumba
Member
From: New Jersey, USA
Registered: 2017-03-31
Posts: 21
Website

Re: [solved] recovering efi boot options

R00KIE wrote:

In theory uefi is great, in practice it is fragile and full of bugs and terrible implementations,

You mean, not quite "Unified"? wink

the problem described here a very good example, there is no way to restore the boot entries to sane/factory defaults, even if that would mean custom entries would be erased.

Short of the recovery USB if created, yeah, no real way of that.

Of course, this also depends on what exactly the OP is looking to "recover". Looking at my ThinkPad's entries, getting back all of those boot menu entries isn't looking hopeful:

Boot0015  Rescue and Recovery	FvFile(665d3f60-ad3e-4cad-8e26-db46eee9f1b5)
Boot0016  MEBx Hot Key	FvFile(ac6fd56a-3d41-4efd-a1b9-870293811a28)
Boot0017* USB CD	VenMsg(bc7838d2-0f82-4d60-8316-c068ee79d25b,86701296aa5a7848b66cd49dd3ba6a55)
Boot0018* USB FDD	VenMsg(bc7838d2-0f82-4d60-8316-c068ee79d25b,6ff015a28830b543a8b8641009461e49)
Boot0019* ATA HDD0	VenMsg(bc7838d2-0f82-4d60-8316-c068ee79d25b,91af625956449f41a7b91f4f892ab0f600)
Boot001A* ATA HDD1	VenMsg(bc7838d2-0f82-4d60-8316-c068ee79d25b,91af625956449f41a7b91f4f892ab0f601)
Boot001B* USB HDD	VenMsg(bc7838d2-0f82-4d60-8316-c068ee79d25b,33e821aaaf33bc4789bd419f88c50803)
Boot001C* PCI LAN	VenMsg(bc7838d2-0f82-4d60-8316-c068ee79d25b,78a84aaf2b2afc4ea79cf5cc8f3d3803)
Boot001D* IDER BOOT CDROM	PciRoot(0x0)/Pci(0x16,0x2)/Ata(0,1,0)
Boot001E* IDER BOOT Floppy	PciRoot(0x0)/Pci(0x16,0x2)/Ata(0,0,0)
Boot001F* ATA HDD	VenMsg(bc7838d2-0f82-4d60-8316-c068ee79d25b,91af625956449f41a7b91f4f892ab0f6)
Boot0020* ATAPI CD	VenMsg(bc7838d2-0f82-4d60-8316-c068ee79d25b,aea2090adfde214e8b3a5e471856a354)
Boot0021* PCI LAN	VenMsg(bc7838d2-0f82-4d60-8316-c068ee79d25b,78a84aaf2b2afc4ea79cf5cc8f3d3803)

Probably the best he'll be able to do without Lenovo's help is restore the Windows Boot Manager and whatever he chose to boot Linux.

Last edited by goumba (2017-04-04 22:59:03)


FSF Associate Member #12876
"Yeah, well, you know, that's just, like, your opinion, man." - The Dude

Offline

#15 2017-04-05 20:28:22

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,680
Website

Re: [solved] recovering efi boot options

Sorry for the delayed response, my Linux laptop is broken sad

R00KIE wrote:
Head_on_a_Stick wrote:

This may sound crazy but you could try deleting the "Arch Linux" NVRAM entry from your firmware menu.

UEFI firmware should fall back to $ESP/EFI/BOOT/BOOT{X64,IA32}.EFI in the absence of any other NVRAM entries and this is what all UEFI-capable ISO images use to boot.

I'm not sure that will work. It should fall back to $ESP/EFI/BOOT/BOOT{X64,IA32}.EFI if there is a generic boot entry to boot from ATA HDD or something similar, in this case there isn't so it will probably see no entries to try to boot from and just do nothing.

Just to add: I have deleted all of the NVRAM entries on my UEFI machines many times and the BOOTX64.EFI entries are generated on-the-fly at boot, as per the specification.

I have also participated in threads here in which clearing all boot entries has reset the UEFI firmware and restored functionality.

At any rate, the OP's laptop is currently non-functional so my suggestion can hardly make things any worse smile

Offline

#16 2017-04-05 22:30:12

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: [solved] recovering efi boot options

@Head_on_a_Stick
That is useful info, having actually tried or knowing the result of trying is a bit more reassuring than crossing the fingers and hope it works smile

@goumba
Yes I know what you mean, but I believe what the OP messed up is not the entries themselves but the boot order (see BootOrder line) and somehow the firmware choked on that. Luckily I did not do that mistake when I started to change stuff on my machine but I can see how easy it is to overlook that detail.


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#17 2017-04-07 01:28:31

goumba
Member
From: New Jersey, USA
Registered: 2017-03-31
Posts: 21
Website

Re: [solved] recovering efi boot options

R00KIE wrote:

@goumba
Yes I know what you mean, but I believe what the OP messed up is not the entries themselves but the boot order (see BootOrder line) and somehow the firmware choked on that. Luckily I did not do that mistake when I started to change stuff on my machine but I can see how easy it is to overlook that detail.

From his screen shots, it appears that he had inadvertently removed all of the boot entries, other than that of Arch.

Unfortunately it seems the OP has gone AWOL and we won't get clarification on the issue. hmm It does seem an easy fix at least to get arch working if he did get back to us.


FSF Associate Member #12876
"Yeah, well, you know, that's just, like, your opinion, man." - The Dude

Offline

#18 2017-04-07 10:00:54

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: [solved] recovering efi boot options

Yes, the screenshots seem to be misleading, I was basing my assumption in what was written in the first post, that 'efibootmgr -o XXXX' was used and not 'efibootmgr -o XXXX,whatever_was_there_before'. As you note the OP seems to have lost interest but at least these ideas will stay documented and might help someone else.


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#19 2017-04-09 23:42:39

rarelymore
Member
Registered: 2017-03-30
Posts: 8

Re: [solved] recovering efi boot options

Hello,
I apologize for the delay in getting back to you all.
@Head_on_a_Stick
I don't object to deleting the last entry and seeing if that fixes the issue. Unfortunately, deleting it means using efibootmgr (as far as I know), which means i need to get it working anyway, and then I can manually add entries, so it seems like the steps to fix this all involve getting efibootmgr to run from the emergency shell.

@R00KIE
Thanks for the continued participation. I'm not going to abandon this fix, and I will surely update as I make progress. The screenshot was intended to clarify my meaning, not obscure. I'm sorry if it was misleading.
You were correct in your initial interpretation that the command that broke the boot order list was 'efibootmgr -o XXXX' (where XXXX represents the four digit sequence associated with the UID for a partition, in my case: 0018)


I did try posting over at lenovo's forum, with no luck.
I'm currently sitting down to troubleshoot, and I'm going to try to take @loqs advice and work to chroot to an Arch Live USB, and see if I can get efibootmgr to run.
I will update if I have success, and I will update if I don't.
Thanks again for all the help!

Last edited by rarelymore (2017-04-09 23:50:24)

Offline

#20 2017-04-10 00:32:38

rarelymore
Member
Registered: 2017-03-30
Posts: 8

Re: [solved] recovering efi boot options

Here is what I'm starting with:
drive.google.com/file/d/0B2uW7A7aAWp6b0 … 8zTEU/view

Last edited by rarelymore (2017-04-10 00:33:50)

Offline

#21 2017-04-10 06:35:00

goumba
Member
From: New Jersey, USA
Registered: 2017-03-31
Posts: 21
Website

Re: [solved] recovering efi boot options

Hmmm... with some of that blacked out, hard to tell, perhaps a typo that you're overlooking?

Last edited by goumba (2017-04-10 06:46:52)


FSF Associate Member #12876
"Yeah, well, you know, that's just, like, your opinion, man." - The Dude

Offline

#22 2017-04-10 07:16:46

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,680
Website

Re: [solved] recovering efi boot options

The `efibootmgr` command can be used from the "live" environment, no need to chroot into your system wink

Also, your firmware menus should have an option to remove NVRAM entries.

Last edited by Head_on_a_Stick (2017-04-10 07:17:20)

Offline

#23 2017-04-10 07:25:37

tom.ty89
Member
Registered: 2012-11-15
Posts: 897

Re: [solved] recovering efi boot options

Head_on_a_Stick wrote:

Also, your firmware menus should have an option to remove NVRAM entries.

That's...really idealistic!

Offline

#24 2017-04-12 14:01:39

rarelymore
Member
Registered: 2017-03-30
Posts: 8

Re: [solved] recovering efi boot options

I'm not having any luck getting efibootmgr to run from the emergency shell.
Also, i don't think there's an option to remove NVRAM entries, at least I have never seen one and can't find one...

Last edited by rarelymore (2017-04-12 14:02:43)

Offline

#25 2017-04-12 20:43:31

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,680
Website

Re: [solved] recovering efi boot options

rarelymore wrote:

I'm not having any luck getting efibootmgr to run from the emergency shell

Any chance of sharing the error message?

tom.ty89 wrote:

That's...really idealistic!

Hope springs eternal smile

Offline

Board footer

Powered by FluxBB