You are not logged in.

#1 2013-07-04 22:44:26

blablubb1234
Member
Registered: 2013-07-04
Posts: 34

[SOLVED]Unable to create EFI boot entry on Lenovo S205 with efibootmgr

Hi community,

longer story:

I once had a S205 dualbooting Archlinux and Windows 7 Ultimate (64bit) on the above mentioned Lenovo IdeaPad S205.
I then upgraded with a SSD and had to setup the dualboot again.

During my first tryout I made a stupid mistake and erased all boot entries using efibootmgr and bricked my laptop.
I got a new one now (same model, only a newer E-450 APU instead of the old E-350 and a different WLAN-Chipset).
I installed Windows 7 Ultimate 64 in EFI mode onto my GPT formated SSD (which worked like a charm) including a working EFI boot entry. This also gave me the Windows-reserved partition and the EFI system partition /dev/sda1 (I guess in FAT32) aka ESP.
Then I installed Archlinux 64 aswell in EFI mode (I checked that ls -l /sys/firmware/efi was NOT empty) following (an older version of) the Beginner's Guide which basically just promoted rEFInd instead of gummiboot (but I dont care which one I end up using, as long as it works). The installation itself worked quite well until I had to install the bootloader:

I copied all the mentioned files and then did

efibootmgr -c -w -d /dev/sdX -p Y -l /EFI/refind/refind_<arch>.efi -L "rEFInd"

to create the efi boot entry for rEFInd to be able to boot Archlinux from it. There was no error message. But as the wiki already says this doesn't necessarily mean that the creation was successfull. And checking back with

efibootmgr

didn't show me a new entry for rEFInd. So I decided to give the UEFI shell a try and manually create the boot entry using bcfg. This even worked and I could finally boot Windows 7 and Archlinux from within rEFInd. So far so good.
But I came across the next problem: My EFI wasn't accessible anymore via F2. Luckily enough I could still access the EFI boot menu using F12 and could boot up Windows 7.
From there I flashed over the original EFI and could thus regain access to the EFI menu via F2. But of course now rEFInd was gone again (unlike Windows Boot Manager, which was still there).
Now it seems the S205's EFI boot menu can only hold 7 entries (Can anyone confirm this? I found one guy saying the same, but that is not very convincing to me yet.) These are my current
EFI boot menu entries.
As you can see in the screenshot using gummiboot instead of rEFInd fails, too. My assumption again being that there is no space left in the NVRAM. So adding a boot entry via EFI shell deletes my "Setup" boot entry, which I can confirm from booting the livestick and doing a plain

efibootmgr

again: Then Boot0000 Setup becomes the rEFInd entry.... now the question is:

How do I dualboot this system without breaking my EFI? Is it safe to delete one of the boot entries (f.i. I don't even know where USB cd and USB FDD come from)? Will I then still be able to boot from a pen drive (like I am doing right now) or an external USB DVD-ROM drive? Or would it even be the best way to delete the Windows 7 boot entry and just have rEFInd boot both OSs? Will that work at all after having deleted the Windows 7 boot entry? Or is it only important that the boot files on the ESP don't get deleted? Would it maybe even be possible to boot Archlinux using the Windows boot manager?

I really hooe you can help me as I am not that familiar with bootloaders and all that stuff hmm

Best regards smile

Last edited by blablubb1234 (2013-07-17 18:36:09)

Offline

#2 2013-07-04 22:52:03

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [SOLVED]Unable to create EFI boot entry on Lenovo S205 with efibootmgr

If you are confident that there is a safe amount of space in your NVRAM to create new entries, you can temporarily boot with efi_no_storage_paranoia in your kernel command line.  But you should be aware that filling of the NVRAM is what was bricking all those Samsungs a new months back.  Also, although it was mostly Samsung machines that were hit, it was not by any means limited to just Samsung computers.  Google efi_no_storage_paranoia for more info about this.

Offline

#3 2013-07-05 03:00:35

srs5694
Member
From: Woonsocket, RI
Registered: 2012-11-06
Posts: 719
Website

Re: [SOLVED]Unable to create EFI boot entry on Lenovo S205 with efibootmgr

blablubb1234 wrote:

I copied all the mentioned files and then did

efibootmgr -c -w -d /dev/sdX -p Y -l /EFI/refind/refind_<arch>.efi -L "rEFInd"

to create the efi boot entry for rEFInd to be able to boot Archlinux from it. There was no error message. But as the wiki already says this doesn't necessarily mean that the creation was successfull. And checking back with

efibootmgr

didn't show me a new entry for rEFInd.

First, the -w option is almost certainly pointless, and the -d and -p options are only necessary if you're using something other than /dev/sda1 as your ESP. In the interests of simplicity and reducing the odds of a typo causing problems, it might be best to drop these, or at least dropping -w.

Second, the -l option requires either doubled-up backslashes ("\\") as directory separators or single backslashes with the pathname in quotes (as in "-l '\EFI\refind\refind_x64.efi'"). Your use of single forward slashes ("/") just plain won't work. Of course, if you copied this over manually, you might have "regularized" the entry for this post, and what you typed originally might have been OK. Also, even this sort of a typo would not cause the entry to not appear; it just wouldn't work when you tried to use it.

But I came across the next problem: My EFI wasn't accessible anymore via F2.

I've heard of this problem before, but I don't know the cause or the solution. I do know that some tools, including rEFInd 0.6.10 and later, and I'm pretty sure in gummiboot, include an option to reboot the computer into the firmware's setup utility. This feature should be enabled by default in rEFInd, but if you've explicitly set the "showtools" line in refind.conf, that line must include the "firmware" option to enable this feature. Also, this feature is only supported by some EFIs; if yours lacks the feature, the relevant option won't appear in rEFInd.

Now it seems the S205's EFI boot menu can only hold 7 entries (Can anyone confirm this? I found one guy saying the same, but that is not very convincing to me yet),

I've never before heard of such a limitation; however, given the outrageous EFI bugs I do know exist, this one wouldn't surprise me. Annoy me, yes. Surprise me, no.

So adding a boot entry via EFI shell deletes my "Setup" boot entry, which I can confirm from booting the livestick and doing a plain

efibootmgr

again: Then Boot0000 Setup becomes the rEFInd entry.... now the question is:

How do I dualboot this system without breaking my EFI? Is it safe to delete one of the boot entries (f.i. I don't even know where USB cd and USB FDD come from)?

Yes, you should be able to safely delete existing entries. OTOH, all the entries you've got look like generic entries created by the firmware itself. If you delete one or more of them, they might just get added back when you reboot, and if there really is a buggy 7-entry limit in your firmware, that might bump one of them off the list.

Something else you might consider is saving your boot manager (rEFInd or gummiboot) as EFI/BOOT/bootx64.efi and deleting the EFI firmware entries for anything else (or deleting boot loader files that correspond to other entries). That way, your boot manager should boot without having an explicit NVRAM entry.

Or would it even be the best way to delete the Windows 7 boot entry and just have rEFInd boot both OSs? Will that work at all after having deleted the Windows 7 boot entry?

rEFInd (or gummiboot or GRUB) can boot Windows even if there's no Windows entry in the NVRAM.

Would it maybe even be possible to boot Archlinux using the Windows boot manager?

No. AFAIK, the Windows boot manager can't chainload to another EFI boot loader, and it certainly can't boot a Linux kernel.

Offline

#4 2013-07-08 08:23:09

blablubb1234
Member
Registered: 2013-07-04
Posts: 34

Re: [SOLVED]Unable to create EFI boot entry on Lenovo S205 with efibootmgr

WonderWoofy wrote:

If you are confident that there is a safe amount of space in your NVRAM to create new entries, you can temporarily boot with efi_no_storage_paranoia in your kernel command line.  But you should be aware that filling of the NVRAM is what was bricking all those Samsungs a new months back.  Also, although it was mostly Samsung machines that were hit, it was not by any means limited to just Samsung computers.  Google efi_no_storage_paranoia for more info about this.

Thanks for the hint. Nevertheless I'm not confident whatsoever if there is enough space in the NVRAM. As I don't want to brick my Laptop again, I guess I will have to try other things... But just out of interest: Is there a way (like maybe with the archiso) to find out how much NVRAM my Notebook has and how much of it is free? Then I could maybe check it out that way and see if it might be an option to use the ef_no_storage_paranoia...

Last edited by blablubb1234 (2013-07-08 11:19:47)

Offline

#5 2013-07-08 08:43:18

blablubb1234
Member
Registered: 2013-07-04
Posts: 34

Re: [SOLVED]Unable to create EFI boot entry on Lenovo S205 with efibootmgr

srs5694 wrote:

First, the -w option is almost certainly pointless, and the -d and -p options are only necessary if you're using something other than /dev/sda1 as your ESP. In the interests of simplicity and reducing the odds of a typo causing problems, it might be best to drop these, or at least dropping -w.

Second, the -l option requires either doubled-up backslashes ("\\") as directory separators or single backslashes with the pathname in quotes (as in "-l '\EFI\refind\refind_x64.efi'"). Your use of single forward slashes ("/") just plain won't work. Of course, if you copied this over manually, you might have "regularized" the entry for this post, and what you typed originally might have been OK. Also, even this sort of a typo would not cause the entry to not appear; it just wouldn't work when you tried to use it.

I think I have to contradict you. The rEFInd entry used to work: I could load both Arch and Win7, but - as I already mentioned - the EFI wasn't accessible anymore (see my quote below).

srs5694 wrote:

But I came across the next problem: My EFI wasn't accessible anymore via F2.

I've heard of this problem before, but I don't know the cause or the solution. I do know that some tools, including rEFInd 0.6.10 and later, and I'm pretty sure in gummiboot, include an option to reboot the computer into the firmware's setup utility. This feature should be enabled by default in rEFInd, but if you've explicitly set the "showtools" line in refind.conf, that line must include the "firmware" option to enable this feature. Also, this feature is only supported by some EFIs; if yours lacks the feature, the relevant option won't appear in rEFInd.

Given the numerous bugs my EFI seems to have I am quite sure that it lacks the feature to boot into the setup utility. Nevertheless I will give this one a try as soon as I got rEFInd/gummiboot installed again.

srs5694 wrote:

Now it seems the S205's EFI boot menu can only hold 7 entries (Can anyone confirm this? I found one guy saying the same, but that is not very convincing to me yet),

I've never before heard of such a limitation; however, given the outrageous EFI bugs I do know exist, this one wouldn't surprise me. Annoy me, yes. Surprise me, no.

So adding a boot entry via EFI shell deletes my "Setup" boot entry, which I can confirm from booting the livestick and doing a plain

efibootmgr

again: Then Boot0000 Setup becomes the rEFInd entry.... now the question is:

How do I dualboot this system without breaking my EFI? Is it safe to delete one of the boot entries (f.i. I don't even know where USB cd and USB FDD come from)?

Yes, you should be able to safely delete existing entries. OTOH, all the entries you've got look like generic entries created by the firmware itself. If you delete one or more of them, they might just get added back when you reboot, and if there really is a buggy 7-entry limit in your firmware, that might bump one of them off the list.

Well, "unfortunately" they don't get added back again after rebooting. That's why my entry "Setup" (for booting into the firmware's setup utility) disappears after manually adding a new entry for rEFInd with the bcfg command. And it doesn't even matter where I put the new entry: bcfg boot add 0 ... aswell as bcfg boot add 5 ... (f.e.) both kick Setup out of the boot entries list.

srs5694 wrote:

Something else you might consider is saving your boot manager (rEFInd or gummiboot) as EFI/BOOT/bootx64.efi and deleting the EFI firmware entries for anything else (or deleting boot loader files that correspond to other entries). That way, your boot manager should boot without having an explicit NVRAM entry.

That's a very useful hint. I will try that. Then I would have to create respective boot entries for Arch and Windows 7 in refind.conf I suppose?

Offline

#6 2013-07-08 14:25:25

srs5694
Member
From: Woonsocket, RI
Registered: 2012-11-06
Posts: 719
Website

Re: [SOLVED]Unable to create EFI boot entry on Lenovo S205 with efibootmgr

blablubb1234 wrote:
srs5694 wrote:

Something else you might consider is saving your boot manager (rEFInd or gummiboot) as EFI/BOOT/bootx64.efi and deleting the EFI firmware entries for anything else (or deleting boot loader files that correspond to other entries). That way, your boot manager should boot without having an explicit NVRAM entry.

That's a very useful hint. I will try that. Then I would have to create respective boot entries for Arch and Windows 7 in refind.conf I suppose?

Probably not for Windows, and perhaps not for Arch. rEFInd is designed to detect boot loaders automatically, so if the boot loaders are in normal locations on the ESP, rEFInd will detect them and create appropriate menu entries.

For Linux it can be more complex, since you can boot Linux via a traditional boot loader (GRUB 2, ELILO, etc.) or via the EFI stub loader built into recent kernels. In the former case, rEFInd will detect the Linux boot loader if it's stored in a sensible location. In the latter case, rEFInd can detect the Linux kernel and add it to the menu, but only if the kernel is on the ESP in a location that rEFInd scans or if you install an EFI filesystem driver for the filesystem on which the kernel is stored. If you use the EFI stub loader, you may also need a refind_linux.conf file in the same directory as the kernel to set kernel options.

That said, some Arch users prefer to disable rEFInd's auto-scanning (controlled via the "scanfor" line in refind.conf) and create manual boot stanzas, much as they would for ELILO or GRUB. This can work reasonably well for Arch, since Arch's standard kernel upgrade procedures involve overwriting old kernels using a standard name rather than copying new kernels alongside old ones and differentiating them with unique filenames. rEFInd's auto-scanning features are most beneficial with the latter approach, since they can detect new kernels using new names with no reconfiguration. By contrast, Arch's naming system obviates the need to make changes to configuration files with kernel upgrades, which are required with most boot loaders (or with rEFInd when using manual boot stanzas) with most distributions.

Offline

#7 2013-07-09 14:10:41

blablubb1234
Member
Registered: 2013-07-04
Posts: 34

Re: [SOLVED]Unable to create EFI boot entry on Lenovo S205 with efibootmgr

Hi srs5694,

are you refefing to the purple box in Booting an OS using UEFI when talking about the <EFI PARTITION>/EFI/BOOT/bootx64.efi file? As I am quite new to UEFI bootloaders, do I get you correct?

The procedure would be:

1) Install Win7 in UEFI mode.

2) Install Archlinux in UEFI mode.

3) Do a

# pacman -S refind-efi

4) Disable the scanfor line in refind.conf and create a manual boot entry for Archlinux (as a Windows should - fingers crossed - be automatically created.)

Am I getting this right? And warning you in advance: I might need some more help with setting up that manual boot entry in refind tongue

Best regards.

Offline

#8 2013-07-09 14:46:30

srs5694
Member
From: Woonsocket, RI
Registered: 2012-11-06
Posts: 719
Website

Re: [SOLVED]Unable to create EFI boot entry on Lenovo S205 with efibootmgr

blablubb1234 wrote:

Hi srs5694,

are you refefing to the purple box in Booting an OS using UEFI when talking about the <EFI PARTITION>/EFI/BOOT/bootx64.efi file?

Not in my previous post. I was referring to how rEFInd creates its boot menu. This is entirely distinct from how the EFI itself decides which boot program to launch.

The procedure would be:

1) Install Win7 in UEFI mode.

2) Install Archlinux in UEFI mode.

3) Do a

# pacman -S refind-efi

4) Disable the scanfor line in refind.conf and create a manual boot entry for Archlinux (as a Windows should - fingers crossed - be automatically created.)

Generally speaking, I do not recommend that new users attempt to create manual boot entries in rEFInd. It's generally easier to let its automatic loader detection work. This may require use of a Linux filesystem driver and/or a /boot/refind_linux.conf file, but those are easier to set up than the manual boot stanzas. There is a default sample manual boot stanza for Windows, but it's disabled by default, so if you were to use this method, you'd need to uncomment or delete the "disabled" line in that boot stanza.

Offline

#9 2013-07-09 17:11:59

the.ridikulus.rat
Member
From: Indiana, USA
Registered: 2011-10-04
Posts: 765

Re: [SOLVED]Unable to create EFI boot entry on Lenovo S205 with efibootmgr

srs5694 wrote:

Second, the -l option requires either doubled-up backslashes ("\\") as directory separators or single backslashes with the pathname in quotes (as in "-l '\EFI\refind\refind_x64.efi'"). Your use of single forward slashes ("/") just plain won't work.

efibootmgr git includes a patch that supports forward slashes for --loader option http://linux.dell.com/cgi-bin/cgit.cgi/ … 3286411378 . This patch is also included in core/efibootmgr-0.6.0-3 pkg https://projects.archlinux.org/svntogit … efibootmgr . So as far as Arch is concerned using "-l /EFI/refind/refind_x64.efi" is valid.

EDIT: I am the author of the patch but in reality I simply copied the forward slashes code from gummiboot setup code and but I also added code for --help option (did not modify actual --help output message) to efibootmgr.

Last edited by the.ridikulus.rat (2013-07-09 17:46:22)

Offline

#10 2013-07-09 17:21:13

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [SOLVED]Unable to create EFI boot entry on Lenovo S205 with efibootmgr

Hey, that is really cool the.ridikulus.rat.  When you say that you added code for the --help option, is that part only in the git version?  I don't see it in the Arch version.

Interestingly, the --help says that --loader defaults to \EFI\redhat\grub.efi, while the man page says that it defaults to \\elilo.efi... hmmmm.

Offline

#11 2013-07-09 17:44:52

the.ridikulus.rat
Member
From: Indiana, USA
Registered: 2011-10-04
Posts: 765

Re: [SOLVED]Unable to create EFI boot entry on Lenovo S205 with efibootmgr

WonderWoofy wrote:

Hey, that is really cool the.ridikulus.rat.  When you say that you added code for the --help option, is that part only in the git version?  I don't see it in the Arch version.

Interestingly, the --help says that --loader defaults to \EFI\redhat\grub.efi, while the man page says that it defaults to \\elilo.efi... hmmmm.

The patch unmodified (without the git commit message and headers) is in Arch pkg. I didn't modify the actual "help" message so I didn't check to which --loader path efibootmgr defaults to, when I wrote the patch. But from http://linux.dell.com/cgi-bin/cgit.cgi/ … mgr.c#n818 I can say the man page is wrong or rather not updated upstream.

The --loader path and -u argument truncation should not be an issue if efibootmgr is ported to use efivarfs and the var size checks removed (which are needed only for old sysfs-efivars). If you are interested you can try a modified efibootmgr fork at https://github.com/fpmurphy/Various/tre … tmgr-0.6.0 (does not include the forward-slashes patch) and my comments regarding the code at https://github.com/fpmurphy/Various/issues/1 . This code creates the variable entry properly but does not add it to the Bootorder list, so the created entry does not show up in UEFI menu (alteast in my Thinkpad E430). I do not know sufficient C to fix the code or to create my own fork of efibootmgr with efivarfs support.

I was able to create a un-truncated entry with long --loader path using modified gummiboot setup (stripping out gummiboot specific code and making it more generic). Gummiboot setup code (and UEFI shell bcfg) do not support embedding extra arguments to the loader the way "efibootmgr -u" supports. You can see the modified gummiboot code at https://bitbucket.org/the_ridikulus_rat … nch/Keshav .

There is another generic project called efivar (formerly libefivar) that provides a userpsace library to access efi variable functions. It supports both efivarfs and sysfs-efivars. Currently the included binary only supports listing the contents of efi variables. The code is at https://github.com/vathpela/efivar and it is available as extra/efivar or in AUR at https://aur.archlinux.org/packages/efivar-git/ (maintained by me).

Last edited by the.ridikulus.rat (2013-07-09 17:47:43)

Offline

#12 2013-07-09 21:31:57

srs5694
Member
From: Woonsocket, RI
Registered: 2012-11-06
Posts: 719
Website

Re: [SOLVED]Unable to create EFI boot entry on Lenovo S205 with efibootmgr

the.ridikulus.rat wrote:

efibootmgr git includes a patch that supports forward slashes for --loader option http://linux.dell.com/cgi-bin/cgit.cgi/ … 3286411378 . This patch is also included in core/efibootmgr-0.6.0-3 pkg https://projects.archlinux.org/svntogit … efibootmgr . So as far as Arch is concerned using "-l /EFI/refind/refind_x64.efi" is valid.

That's a good feature; I'm sure it will prevent a lot of problems. Have you submitted this patch upstream, and if so, has it been accepted by the efibootmgr maintainers? IIRC, most Linux tools that refer to EFI paths accept forward slashes, so having efibootmgr do so makes sense.

Offline

#13 2013-07-09 21:39:01

the.ridikulus.rat
Member
From: Indiana, USA
Registered: 2011-10-04
Posts: 765

Re: [SOLVED]Unable to create EFI boot entry on Lenovo S205 with efibootmgr

srs5694 wrote:
the.ridikulus.rat wrote:

efibootmgr git includes a patch that supports forward slashes for --loader option http://linux.dell.com/cgi-bin/cgit.cgi/ … 3286411378 . This patch is also included in core/efibootmgr-0.6.0-3 pkg https://projects.archlinux.org/svntogit … efibootmgr . So as far as Arch is concerned using "-l /EFI/refind/refind_x64.efi" is valid.

That's a good feature; I'm sure it will prevent a lot of problems. Have you submitted this patch upstream, and if so, has it been accepted by the efibootmgr maintainers? IIRC, most Linux tools that refer to EFI paths accept forward slashes, so having efibootmgr do so makes sense.

Yes, this has been added to efibootmgr upstream git (see the 1st link) and available in Arch's pkg too. But I do not know whether this change will be picked by other distros if thats what you meant. The patch is actually very small but helps in removing confusion reg. escaping back-spaces in "-l" option, especially in shell scripts (I really got vexed reg this while writing efibootmgr part in Archboot). I wonder why did the efibootmgr dev initially make "-l" accept only EFI/Windows style paths. In a similar way, even the efistub code in the kernel (I guess from version 3.8, not sure) supports forward-slash in "initrd=" path. The initial efistub code supported only EFI style paths for "initrd=" option.

Offline

#14 2013-07-10 01:32:46

srs5694
Member
From: Woonsocket, RI
Registered: 2012-11-06
Posts: 719
Website

Re: [SOLVED]Unable to create EFI boot entry on Lenovo S205 with efibootmgr

the.ridikulus.rat wrote:

I wonder why did the efibootmgr dev initially make "-l" accept only EFI/Windows style paths.

Almost certainly because it's easier. Passing something through unchanged takes less effort than scanning the path for "/" characters to change to "\" characters. There's also the theoretical possibility of a filename that includes a "/" character -- at least, I think that's legal in FAT. Of course, no Linux boot program would include such a character; but efibootmgr can be used to add non-Linux boot programs to the ESP. That's admittedly a pretty exotic scenario, and I personally wouldn't worry about it, but it's conceivable that the original efibootmgr programmers did worry about it.

Offline

#15 2013-07-10 14:11:33

blablubb1234
Member
Registered: 2013-07-04
Posts: 34

Re: [SOLVED]Unable to create EFI boot entry on Lenovo S205 with efibootmgr

srs5694 wrote:
blablubb1234 wrote:

Hi srs5694,

are you refefing to the purple box in Booting an OS using UEFI when talking about the <EFI PARTITION>/EFI/BOOT/bootx64.efi file?

Not in my previous post. I was referring to how rEFInd creates its boot menu. This is entirely distinct from how the EFI itself decides which boot program to launch.

Well I understood the above mentioned note from the wiki page on UEFI

Note: On some UEFI systems the only possible way to launch UEFI application on boot (if it doesn't have custom entry in UEFI boot menu) is to put it in this fixed location: <EFI SYSTEM PARTITION>/EFI/boot/bootx64.efi (for 64-bit x86 system)

as if loading the /EFI/Boot/bootx64.efi file would be a standard procedure of UEFI firmware if it could not find any other loader or the like. But if that should be wrong: How does the UEFI itself than decide which boot program to launch?

srs5694 wrote:

Generally speaking, I do not recommend that new users attempt to create manual boot entries in rEFInd. It's generally easier to let its automatic loader detection work. This may require use of a Linux filesystem driver and/or a /boot/refind_linux.conf file, but those are easier to set up than the manual boot stanzas. There is a default sample manual boot stanza for Windows, but it's disabled by default, so if you were to use this method, you'd need to uncomment or delete the "disabled" line in that boot stanza.

Okay, I am also fine with that. However, what I did so far is:

1) I installed Windows 7 in UEFI mode (which automatically (and successfully) created a UEFI boot entry.

2) I installed Arch from the latest archiso (2013_07) in UEFI mode and installed refind-efi and copied over the files/directories to the ESP.

3) I wanted to copy over /usr/lib/refind/refind_x64.efi to /<EFI PARTITION>/EFI/Boot/bootx64.efi but that file already exists.

As I didn't want to break anything yet, I stopped copying the file and am so far stuck with a bootable Windows 7 but an Arch I cannot boot (yet). So where does that "old" bootx64.efi come from? Can I safely delete/replace it? And how do I tell my UEFI to launch that file and with it rEFInd by default? Is that what you meant, srs5694?

Best regards.

Last edited by blablubb1234 (2013-07-10 19:09:06)

Offline

#16 2013-07-10 16:42:53

srs5694
Member
From: Woonsocket, RI
Registered: 2012-11-06
Posts: 719
Website

Re: [SOLVED]Unable to create EFI boot entry on Lenovo S205 with efibootmgr

blablubb1234,

There have been so many changes in your situation and digressions (my apologies for my part in those) that it's unclear to me just what your current situation and problem are. I can say the following, to answer questions in your latest post:

  • Your understanding of EFI/BOOT/bootx64.efi seems to be correct -- it's the fallback boot loader for the EFI itself, should all the firmware's NVRAM entries be missing, invalid, or otherwise unbootable. Note that on most systems, the NVRAM boot entries take precedence over EFI/BOOT/bootx64.efi.

  • The EFI/BOOT/bootx64.efi file could in principle be anything. That's one of the problems with using it -- you can't know what it is just by checking its filename. In practice, though, in your case it's probably a copy of the Windows boot loader. The Windows installer places copies of the Windows boot loader at both EFI/Microsoft/Boot/bootmgfw.efi and at EFI/BOOT/bootx64.efi. Some Linux distributions have taken to copying their boot loaders to EFI/BOOT/bootx64.efi, though, so in principle it could be a Linux boot loader or even something else.

  • If you want to store another boot program at EFI/BOOT/bootx64.efi, I recommend you either use "diff" to try to figure out what EFI/BOOT/bootx64.efi is (and with any luck confirm that you can safely delete it) or rename EFI/BOOT to something else before creating a new EFI/BOOT directory and placing your own boot program within it. If you rename EFI/BOOT, you can easily undo this change; and rEFInd will scan any boot loaders that directory contains under its new name, should you launch rEFInd.

Offline

#17 2013-07-10 20:36:09

blablubb1234
Member
Registered: 2013-07-04
Posts: 34

Re: [SOLVED]Unable to create EFI boot entry on Lenovo S205 with efibootmgr

srs5694 wrote:

blablubb1234,

There have been so many changes in your situation and digressions (my apologies for my part in those) that it's unclear to me just what your current situation and problem are.

First of all thank you very much for your patience and your help smile I will try my best to make things clear now:

The situation basically is still the same as it was at the beginning: I have Windows 7 and Archlinux installed in UEFI mode. Windows setup (successfully) created a NVRAM boot entry, so I can boot into Windows perfectly fine. However, using efibootmgr fails to create NVRAM entries (due to my assumption that my EFI cannot hold more entries) for Archlinux. If using the bcfg command in an UEFI shell to manually create a NVRAM entry for Archlinux, the EFI setup utility (usually accessible via F2) gets kicked out of the boot list and I can't reach it anymore afterwards (until flashing over the original EFI again using that stupid unsafe Lenovo Winflash utility -.-). That's why I have to figure out a way to start rEFInd/gummiboot without having an explicit NVRAM entry for either one of them. And your hint about placing an UEFI bootloader as /EFI/Boot/bootx64.efi seems the proper way to reach this goal without breaking EFI setup utility.

But let me work off your list:

srs5694 wrote:

I can say the following, to answer questions in your latest post:

  • Your understanding of EFI/BOOT/bootx64.efi seems to be correct -- it's the fallback boot loader for the EFI itself, should all the firmware's NVRAM entries be missing, invalid, or otherwise unbootable. Note that on most systems, the NVRAM boot entries take precedence over EFI/BOOT/bootx64.efi.

  • The EFI/BOOT/bootx64.efi file could in principle be anything. That's one of the problems with using it -- you can't know what it is just by checking its filename. In practice, though, in your case it's probably a copy of the Windows boot loader. The Windows installer places copies of the Windows boot loader at both EFI/Microsoft/Boot/bootmgfw.efi and at EFI/BOOT/bootx64.efi. Some Linux distributions have taken to copying their boot loaders to EFI/BOOT/bootx64.efi, though, so in principle it could be a Linux boot loader or even something else.

  • If you want to store another boot program at EFI/BOOT/bootx64.efi, I recommend you either use "diff" to try to figure out what EFI/BOOT/bootx64.efi is (and with any luck confirm that you can safely delete it) or rename EFI/BOOT to something else before creating a new EFI/BOOT directory and placing your own boot program within it. If you rename EFI/BOOT, you can easily undo this change; and rEFInd will scan any boot loaders that directory contains under its new name, should you launch rEFInd.

  • Okay I'm glad I got something right afterall smile I assume all entries like USB, CD, Network are flagged "unbootable" in this context, as long as the respective media is not connected to my Laptop? Then the only remaining entries which would have priority ofter bootx64.efi would be the SSD itself (shows up as "Samsung SSD 840 PRO") and the Windows Boot Manager.

  • Thanks to your tip with diff I found out that /EFI/Boot/bootx64.efi is the exact same file as /EFI/Microsoft/Boot/bootmgrfw.efi - so it is a copy of the Windows Bootloader.

  • So I could safely overwrite that file with rEFInd or gummiboot, right? But still, if I understood you correct, the Windows Boot Manager entry in the boot menu would have priority over the new /EFI/Boot/bootx64.efi. So should I still put rEFInd/gummiboot (which of both do you prefer/recommend after all?) at /EFI/Boot/bootx64.efi and delete the NVRAM entry for Windows Boot Manager and the SSD? Or would that just result in an unbootable Laptop? I am really scared about deleting the NVRAM entry for the SSD ... that somehow seems very wrong.

I hope this time it became clear what the problem is. I am sorry for the many questions inbetween. Again,

Best regards.

PS: These are my current NVRAM entries

Last edited by blablubb1234 (2013-07-11 21:26:50)

Offline

#18 2013-07-10 21:16:34

the.ridikulus.rat
Member
From: Indiana, USA
Registered: 2011-10-04
Posts: 765

Re: [SOLVED]Unable to create EFI boot entry on Lenovo S205 with efibootmgr

@blablubb1234: The reason bcfg is overwriting the "Setup" variable (by default Boot0000 in my Lenovo Thinkpad E430, check "efibootmgr -v" output for the actual variable ID in your system) is because you used

bcfg boot add 0 ......

Try some other number - like "7" below

bcfg boot add 7 fs0:\EFI\refind\refind_x64.efi "rEFInd"

EDIT: Can you post your full "efibootmgr -v" output?

Last edited by the.ridikulus.rat (2013-07-10 21:28:10)

Offline

#19 2013-07-10 21:21:23

the.ridikulus.rat
Member
From: Indiana, USA
Registered: 2011-10-04
Posts: 765

Re: [SOLVED]Unable to create EFI boot entry on Lenovo S205 with efibootmgr

@blablubb1234: Check whether there are "dump-type*" files (kernel pstore dumps in EFI NVRAM) in /sys/firmware/efi/efivars, if so delete them and reboot after adding kernel parameter "efivars.pstore_disable=1" (for kernel < 3.10) or "efi_pstore.pstore_disable=1" (for kernel >=3.10) when booting the iso or the installed system.

# rm /sys/firmware/efi/efivars/dump-type*

I have done this safely in my Thinkpad E430 without any issues so far (I am using kernel 3.10).

Last edited by the.ridikulus.rat (2013-07-10 21:26:01)

Offline

#20 2013-07-10 21:23:54

srs5694
Member
From: Woonsocket, RI
Registered: 2012-11-06
Posts: 719
Website

Re: [SOLVED]Unable to create EFI boot entry on Lenovo S205 with efibootmgr

blablubb1234 wrote:

PS: These are my current NVRAM entries: http://picpaste.de/pics/a89b754f23f4852 … 489225.JPG
Can you see my screenshots after all?! I somehow cannot see them hmm

The forum software seems to be preserving the URL in the message but hiding it when displaying it. Try surrounding it with url tags, as in [ url ]http://foo.example.com/bar.JPG[ /url ] (but without the spaces within the tags. I've done that to your URL in the quote above.

As to your problem, here are some options:

  • You can put rEFInd or gummiboot on a USB flash drive as EFI/BOOT/bootx64.efi. If you plug that into your computer on a permanent basis and set the firmware to favor booting from it, the result should be pretty good. There are even very low-profile USB flash drives so that the device will sit in the computer unobtrusively. This will work better with rEFInd than with gummiboot, though, since the latter can only load kernels (and I believe other boot loaders) from its own partition, so you'd need to put your Linux kernels and a copy of Microsoft's boot loader on the USB flash drive. That will slow down Linux boot times. By contrast, rEFInd can launch an EFI program from any partition that it can read, so rEFInd stored on a USB flash drive can boot a Linux kernel from a hard disk partition.

  • Removing the Windows boot loader from the list and instead adding rEFInd might work; however, Windows might then re-add its own boot loader back to the list when it reboots, and that might trigger the loss of your F2 functionality, if your hypothesis about what's causing that loss is correct.

  • Installing rEFInd, gummiboot, or whatever under the name EFI/Microsoft/Boot/bootmgfw.efi, first moving that file to another name, might also work. Unfortunately but understandably, some people have reported that Windows sometimes replaces that file with its own boot loader,  so this solution might be short-lived.

Ultimately, though, the solution is to get a fixed firmware. Unfortunately, your manufacturer might not offer such a thing; too many of them take the attitude that if it boots Windows, their job is done. Still, it's worth checking for an update, and complaining about the problem if you can't find one. You might even consider returning the computer if you can't get it working properly. In fact, if you can't get it working well I urge you to return it. A return will cost the manufacturer money, which is about the only thing that will attract any attention from a manufacturer, and if you explain the reason for the return, may cause them to take steps to correct the problem. Absent such attention, a manufacturer who ships a cruddy firmware today is likely to keep shipping cruddy firmware next year, the year after that, and so on.

Offline

#21 2013-07-10 21:26:03

srs5694
Member
From: Woonsocket, RI
Registered: 2012-11-06
Posts: 719
Website

Re: [SOLVED]Unable to create EFI boot entry on Lenovo S205 with efibootmgr

the.ridikulus.rat wrote:

@blablubb1234: The reason bcfg is overwriting the "Setup" Boot0000 variable (check "efibootmgr -v" output) is because you used

bcfg boot add 0 ......

Try some other number - like "7" below

bcfg boot add 7 fs0:\EFI\refind\refind_x64.efi "rEFInd"

Good catch. That's a more plausible explanation for the loss of the F2 functionality than a 6-item limit in the NVRAM's boot loader list.

Offline

#22 2013-07-10 21:40:15

blablubb1234
Member
Registered: 2013-07-04
Posts: 34

Re: [SOLVED]Unable to create EFI boot entry on Lenovo S205 with efibootmgr

srs5694 wrote:
the.ridikulus.rat wrote:

@blablubb1234: The reason bcfg is overwriting the "Setup" Boot0000 variable (check "efibootmgr -v" output) is because you used

bcfg boot add 0 ......

Try some other number - like "7" below

bcfg boot add 7 fs0:\EFI\refind\refind_x64.efi "rEFInd"

Good catch. That's a more plausible explanation for the loss of the F2 functionality than a 6-item limit in the NVRAM's boot loader list.

I thought I had mentioned that before: It doesn't matter at which position I insert the new boot entry. It always kicks out Boot0000 aka Setup. I will come back to the rest tomorrow and post the output of efibootmgr -v as its quite late over here. Thanks so much so far smile

Best regards.

Offline

#23 2013-07-10 21:41:50

the.ridikulus.rat
Member
From: Indiana, USA
Registered: 2011-10-04
Posts: 765

Re: [SOLVED]Unable to create EFI boot entry on Lenovo S205 with efibootmgr

srs5694 wrote:
the.ridikulus.rat wrote:

@blablubb1234: The reason bcfg is overwriting the "Setup" Boot0000 variable (check "efibootmgr -v" output) is because you used

bcfg boot add 0 ......

Try some other number - like "7" below

bcfg boot add 7 fs0:\EFI\refind\refind_x64.efi "rEFInd"

Good catch. That's a more plausible explanation for the loss of the F2 functionality than a 6-item limit in the NVRAM's boot loader list.

I don't think there is any 6-item limit to NVRAM entries as I have Boot0000-Boot0018 entries in my Thinkpad E430's NVRAM. If you see below the "Setup" Variable is actually at Boot0018. Initiall it was at Boot0000 but after a firmware update it moved to Boot0018 freeing up Boot0000 for my "BOOTX64.EFI" variable. I don't have any issues so far wrt booting or efivars in my system.

# efibootmgr -v
BootCurrent: 0013
Timeout: 1 seconds
BootOrder: 0013,0014,0012,0017,0011,0016,0015,0000,000A,000D,0008,0009,0007,000E,000B,000C
Boot0000* BOOTX64.EFI	HD(1,800,200000,f5e1ef99-752e-4041-855d-aca8a7cc0d03)File(\EFI\boot\bootx64.efi)
Boot0001  Boot Menu	
Boot0002  Diagnostic Splash Screen	
Boot0003  Lenovo Diagnostics	
Boot0004  Startup Interrupt Menu	
Boot0005  ME Configuration Menu	
Boot0006  Rescue and Recovery	
Boot0007* USB CD	030a2400d23878bc820f604d8316c068ee79d25b86701296aa5a7848b66cd49dd3ba6a55
Boot0008* USB FDD	030a2400d23878bc820f604d8316c068ee79d25b6ff015a28830b543a8b8641009461e49
Boot0009* ATAPI CD0	030a2500d23878bc820f604d8316c068ee79d25baea2090adfde214e8b3a5e471856a35401
Boot000A* ATA HDD0	030a2500d23878bc820f604d8316c068ee79d25b91af625956449f41a7b91f4f892ab0f600
Boot000B* ATA HDD1	030a2500d23878bc820f604d8316c068ee79d25b91af625956449f41a7b91f4f892ab0f601
Boot000C* ATA HDD2	030a2500d23878bc820f604d8316c068ee79d25b91af625956449f41a7b91f4f892ab0f602
Boot000D* USB HDD	030a2400d23878bc820f604d8316c068ee79d25b33e821aaaf33bc4789bd419f88c50803
Boot000E  PCI LAN	030a2400d23878bc820f604d8316c068ee79d25b78a84aaf2b2afc4ea79cf5cc8f3d3803
Boot000F* IDER BOOT CDROM	ACPI(a0341d0,0)PCI(16,2)ATAPI(0,1,0)
Boot0010* IDER BOOT Floppy	ACPI(a0341d0,0)PCI(16,2)ATAPI(0,0,0)
Boot0011* UEFI Shell v2	HD(1,800,200000,f5e1ef99-752e-4041-855d-aca8a7cc0d03)File(\EFI\tools\shellx64_v2.efi)
Boot0012* GRUB	HD(1,800,200000,f5e1ef99-752e-4041-855d-aca8a7cc0d03)File(\EFI\grub\grubx64.efi)
Boot0013* Gummiboot	HD(1,800,200000,f5e1ef99-752e-4041-855d-aca8a7cc0d03)File(\EFI\gummiboot\gummibootx64.efi)
Boot0014* rEFInd	HD(1,800,200000,f5e1ef99-752e-4041-855d-aca8a7cc0d03)File(\EFI\refind\refind_x64.efi)
Boot0015* Windows Boot Manager	HD(1,800,200000,f5e1ef99-752e-4041-855d-aca8a7cc0d03)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.}...a................
Boot0016* UEFI Shell v1	HD(1,800,200000,f5e1ef99-752e-4041-855d-aca8a7cc0d03)File(\EFI\tools\shellx64_v1.efi)
Boot0017* Syslinux	HD(1,800,200000,f5e1ef99-752e-4041-855d-aca8a7cc0d03)File(\EFI\syslinux\syslinux.efi)
Boot0018  Setup	

Offline

#24 2013-07-11 02:56:41

srs5694
Member
From: Woonsocket, RI
Registered: 2012-11-06
Posts: 719
Website

Re: [SOLVED]Unable to create EFI boot entry on Lenovo S205 with efibootmgr

the.ridikulus.rat wrote:

I don't think there is any 6-item limit to NVRAM entries as I have Boot0000-Boot0018 entries in my Thinkpad E430's NVRAM.

If there's one thing I've learned about EFI, it's to never assume that something true of one implementation is true of another. Even one manufacturer's products can vary greatly from one version to another, so a bug like this might have crept into one model or even just one specific version of the firmware.

Offline

#25 2013-07-11 03:40:25

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [SOLVED]Unable to create EFI boot entry on Lenovo S205 with efibootmgr

srs5694 wrote:

...so a bug like this might have crept into... even just one specific version of the firmware.

This is something that I find incredible and have experienced myself actually.

Offline

Board footer

Powered by FluxBB