Linbo EFI problems with Lenovo L15 Gen2 (11th gen) laptop

Greetings,

The laptops in the title (Lenovo Thinkpad L15 Gen2 type 20X4) make up a very large part of our client base, so it would be nice if we could get Linbo to work on them.
The phenomenon is as follows, I create the partitions with the description Linbo, then install Win 11 ltsc with installation media, then when I should boot with Linbo after the installation (green button), it fails to restore windows efi boot files with a message, it cannot boot, and then both Linbo grub efi and Windows Efi entry in Lenovo bios are deleted from boot options, but Windows efi can be restored automatically, of course after that I can start fallback Linbo from pxre, which of course again ejects Windows efi and goes into an infinite loop.

What I’ve tried so far;

Since the vmd storage controller cannot be disabled in the laptop bios (hidden option), I first thought that this is the reason why Linbo does not see the nvme drive behind the vmd controller properly. So I integrated the vmd driver into the Windows installer, and recompiled Linbo from source with config_vmd=y stable kernel paramter, but these didn’t help.

Linbo kernel parameters, like noefibootmgr and forcegrub, also did not help.

What I haven’t exhausted the possibilities of yet, because I considered it as a last resort, is manual efi editing in the Linbo terminal. Here I have only done so far by manually adding a Windows Efi boot entry, but pressing the green button also led to the loop above.
There must be potential in this, but I’m not an efi wizard :blush:, how much easier and problem free life was with mbr, it was concrete stable, but unfortunately time has passed it by, but this Windows efi likes to live a life on its own anyway, even if it works fine. :crazy_face:

If anyone has had a similar efi problem please share what your solution was, if any maybe I can find it sooner than just blindly dabbling on my own.To the specific machine, I’ll get back to it only from Monday, but until then, you can come to the brainstorming.

Thanks, Fenyő

In the meantime, I tried it with the longterm kernel instead of the default stable one, unfortunately without any result, and with the same result, after installing Windows, both efi entries exist, but as soon as I start it with Linbo, both of them fall apart, Windows then automatically restores, but Linbo can only be restored manually, but actually, it’s useless, because from then on it’s an infinite loop.
Maybe the solution is to make an image on another machine and then try to clone it back to these Lenovos and disable Sync on them, or since it bleeds to death at startup, would Windows not start with Linbo? Or is there a workaround afterwards, so that the Linbo start on the Lenovo machine doesn’t want to change the efi entry?

And I was also thinking that since I’m planning to multiboot anyway, how about Ubuntu’s grub as the default afterwards (you can set windows as the primary) and hide windows’ start and sync buttons. Of course, the question is, would the ubuntu efi of Lenovo gen2 machines be handled correctly by Linbo? Although since the Linbo is also built under Ubuntu, I suspect that it will have no problem with that, the point is that it would avoid having windows boot directly through the Linbo, only through the Ubuntu grub.

Hi Fenyő,
I never heard of these „vmd-Options“ – so I can’t say much about it.
But maybe there’s an option for GRUB2: It’s not absolutely neccessary to use LINBO every time the clients starts. There’s a way to use the GRUB-Menu itself. This won’t solve your problem but at least it’s could be possible to boot windows without LINBO?!

I’m no EFI-wizzard neither … all I can tell is that we still use Win10 on our clients. You can find some threads in this forum about Win11.

You can also try to boot LINBO via PXE, login and start a terminal. What’s the output of blkid or fdisk -l there? Are there all partitions and correct filesystems?

Greetings,
Michael

Hi Fenyo,

very good point made by Michael: the Partitions.
Microsoft introduced a new Partition with win11 24H2 … which is not represented in the default start.conf of linbo.
Please do as Michael sugestet: start the Cleint with an USB Stick linux and look at the Partitions.
Are they all as they should bein the start.conf.HARDWARECLASS of the Client?
Or are there more?
Win11 might have created an extra Partition when you installed it, which would move the linbopartition on Number back which would lead to the Penomenon, that grub in the efi Partition could not find the linbo anymore.

Yours
Holger

Yes, I was wondering if these Lenovo laptops don’t work with Linbo start (10th Gen or older machines have no problem, I’ve tried with 8th gen HP, 10th gen Lenovo and some Intel Pentium Asus netbook (efi only is newer than Lenovo), they had no problem with Windows 11 with Linbo only this 11th Gen Lenovo (unfortunately by far the most of them), but I haven’t looked with Win 10, but I wouldn’t want to put it back anyway, because at the end of the year the support expires), then I do a Windows and Ubuntu installation on another client, then I clone it to 11th Gen Lenovo, I hide the Windows menu, only Ubuntu will be active and then Windows will start from its grub, this does not solve the problem, but I can get around it.
Anyway, all the necessary paritions are created on the Lenovo (efi, msr, cahce, ubuntu, swap, windows), as long as I don’t boot it with Linbo start, I can see it in terminal (efibootmgr), all Windows, and Linbo’s grub efi entry is nicely visible, this is completely messed up by Linbo start, I think there might be some protection in Lenovo that doesn’t let Linbo mess with Windows efi, but I’m just guessing.
Holger: I can be more precise tomorrow (exact fdisk output), but I’m trying with Win 11 iot ltsc (it’s also based on 24h2, if everything is true, just lower system requirements) and it installs on older laptops without problems with the partition scheme above, only the 11th gen lenovo fails with Linbo start.
So may I need a Windows recovery partition for my Lenovo machine? How should I create it with Linbo? As a plain data partition? Because there is only efi, msr and Windows, WRP is not among the options.

I have also checked with Windows 10, the ominous Lenovo machine, and the situation is the same with that, so it is clear to me that the problem is not with Windows 11, as it runs without problems on the other machines, but this Lenovo machine is not compatible with Linbo unfortunately, I would guess that some security feature does not allow Linbo, to write to Windows in Efi, so then I’ll probably have to make a backup plan, make a multiboot system on another machine and clone it to the Lenovo, where I disable the Windows buttons and only Ubuntu will be active and Windows will run through its grub.
I’ll paste the efibootmgr -v and fdsik -l outputs of the Lenovo machine above here, before booting it with Linbo.

Let’s say the Windows efi always puts itself first in the boot order on this machine, interesting that here it is second according to the output, although in the bios it is listed first, maybe this could confuse things, that Linbo is trying to write to the wrong efi? But I tried it by setting Windows back in the bios and it didn’t help, of course I didn’t check the efi output under terminal.
And yes it seems both efi entries are competing for the 0th spot so they keep knocking each other out…

Hi Fenyo,

i dont think so.
We have EFI Support for many Years now and i have seen really dificult Cases: but each and every one we succeeded to run linbo on: it just takes time and tinkering.

Lets clarify a few things:
Did you use a win11 Image which is currently working on other Machines in your Netwerk (also UEFI Booting)? or did you install anew?

When i got the answer, there will be more questions :slight_smile:
Yours HOlger

Hello Holger,

I’m not trying to clone (that’s just the escape plan), I’m trying to do a clean install, but it seems that this Lenovo’s bios, somehow if I have more than one efi, it’s not really up to the task, it always tries to put the last one I installed and booted into slot 0, so they knock each other out…
Even if I boot with pxe after installing windows, I set pxe to be 0, grub 1, win 2, then when I look at the efi output in terminal, grub is 0, win is 1, but as soon as I reboot the machine, both efi entries are deleted.Then windows recovers but grub doesn’t, it’s like it only tolerates one efi entry.
And as I looked with efibootmgr, it didn’t really let me change the bootorder, so from here it seems likely that the Lenovo efi is under some kind of firmware protection.

Hi Fenyo,

why dont you just clone a already finished Win11 on it?
Thats whta linbo is for.

Problems with EFI should be counterd in this Way:

  1. update the BIOS to the current version: maybe the did even fix a Bug …
  2. get familiar with the possible Settings in the EFI: often there are Options like: „Protect Boot Settings“ or „Lock Boot Settings“.
    Anything related to booting is interesting.
    Turn such „lock“ Settings off.
  3. try booting linbo via IPv4network

After that: every misboot should be observed very closely.
Turn in linbo the splash screen off
and write us a very detailed description.

It is interesting, what Folders are to be found on the EFI Partition (FAT32) when a boot is unsuccessfull.

Yours
Holger

  1. bios is the latest
  2. bios settings I have already juggled through, which may be relevant with lock boot order and secure boot disabled
  3. tried pxe boot, as I wrote above, but after I boot into linbo with it, I don’t even need to boot into windows, after rebooting it will delete at least one of the efi entries anyway (depending on how the boot order was set), but usually both, and in this case only windows is restored, as if it was the only one on the white-list, and it always tries to push it to the first place anyway. Here’s a picture when only the Win efi was deleted, but only from the bios entry, everything on the partition always stays there, it still seems to me that something is firmware protecting this efi and not allowing external programs to tamper with it.

To remove Linbo splash I would have to clear the Linbo cache (the update doesn’t allow it), so now I could only make a motion picture with esc sorry

From this I guess that just a simple Windows clone would not seem to solve the problem of this machine, max with multiboot I could avoid it being able to boot directly through Windows efi.

I may have found the solution; I boot the gen2 Lenovo machine with pxe, create the partitions, then start installing Windows, after it reboots first and creates the efi entry, I enter the bios, set the boot order to pxe, grub, windows, then lock the option to change the boot order, so after rebooting it boots with pxe, I click on windows start, it throws an error, because the entries are locked the entries remain, so it boots with windows, after rebooting windows after resuming the installation it boots with pxe again and I can press start again so it boots to windows again. The question is, can I and how can I clone this to the other machines? Most interesting will be the Windows efi entry on how I add it to the bios of the cloned machine.

What could be the reason, I’m also still on the gen2 machine, and I put a Zorin os (Ubuntu 22.04 based and using gnome, so it should be compatible) on it, also fixed the efi in boot order, but it won’t boot with the Linbo green start button, just the big blackness. However, I can boot it with f12 bootmenu, but it won’t boot from Linbo.

UPDATE:
I found the bug, the kernel and intird entries in start.conf point to symbolic references, which Linbo can’t seem to read, if I fix the real kernel names that are in the boot directory of the zorin os, then Zorin will start from Linbo with the start button as it should. :slightly_smiling_face:
Alternatively, the symbolic kernel can stay, initrd is causing the error, commenting it out works, so it seems that the initrd of Zorin os is not compatible with Linbo, no graphical grub so I think I survive. :smile:

Hi Fenyo,

the efi Boot Entry will becloned by linbo to other Machines: it is just the Bootcode in the EFI Machine AND the settings inside EFI (which linbo sets with the Program efiboomgr ).
The Problem is: if Machines (like yourse) are not behaving well with efi and efiboot, it will be interesting to clone.
Setting the boot lock setting in EFI will prevent linbo from setting Things right.

There was Someone here in the Forum, maybe a year ago, who had the Problem, that the efi was mixing up the correct boot Order all the time. He made a Task in Windows, set it as „on Shutdown“ and set it to set the efi bootorder right.
Thats another workaround with faulty EFI Code.

Yours
Holger

Thanks, i see, so after every shutdown the script creates an efi entry, so even if Lenovo firmware deletes the entries at its own convenience, it seems logical, but it should be known exactly when and how it deletes them, because it doesn’t seem consistent, Windows likes to put them first, etc. If present, the others are deleted, but not always, and if deleted, Win is usually restored, but not always, while if another entry is deleted, it is permanent, can only be restored manually, if possible. Separately complicates it that way then I suppose for Zorin and would you need a shutdown script that recreates your efi if it is deleted? Well the proof of the pudding is in the eating, I can create the images this way, question is what happens when I clone back to another one of these clients. If boot order change is enabled during cloning, can the efi entry be created in the bios? Because if so that would be too easy (after restart it could be locked again), other solution could be some efi recovery script for these machines after cloning…

It’s possible to clone back on the gen2 Lenovo machine, but especially for Zorin it’s a bit tricky. On the original machine, I was able to add the systems by enabling boot order change until I installed the 2 op systems from the installation media, but not once after that did I allow either Linbo or one of the op to boot, so it created all 3 efi entries in the bios, put them in order (pxe, grub, win, ubuntu), and then locked the boot order so nothing can arbitrarily delete and/or reorder them. I could then set both op’s smoothly, to the point where they can enter the domain and are cloned to linbo.
During the clone back (here in case of an unknown client, dhcpretry 3 may also be insufficient, so in the grub of the linbo, I increased the failsafe boot kernel option to a safe 10) I also enabled the boot order change on the clone client, cloned the 2 operating systems, if win boots it will usually kill everything around itself, if I only need Win it wouldn’t be bad after all. So after I have done the clones biosba on and all defaults on, so I delete the efi (now only win) entries, secure boot off and boot order change enabled, then pxe boot, this automatically creates the Linbo efi entry, then I enter terminal and create the windows and ubuntu efi entries with efibootmgr. It is important to note that the zorin/ubuntu efi is not fully cloned during cloning, so it has to be copied (I copied it from the original machine), and the uuids in fstab have to be changed to dev everywhere, because the uuids are not cloned. So that you don’t have to manually type it all the time, I made a script on a usb pendrive (which you just mount, make executable and run).

#!/bin/bash

#EFI mount
mkdir -p /mnt/efi
mount /dev/nvme0n1p1 /mnt/efi

#Pendrive mount
mkdir -p /mnt/usb
mount /dev/sda1 /mnt/usb

#EFI bejegyzések létrehozása
efibootmgr --create --disk /dev/nvme0n1 --part 1 --loader ‚\EFI\Microsoft\Boot\bootmgfw.efi‘ --label ‚Windows Boot Manager‘ --verbose
efibootmgr --create --disk /dev/nvme0n1 --part 1 --loader ‚\EFI\ubuntu\shimx64.efi‘ --label ‚ubuntu‘ --verbose

#EFI fájlok másolása pendrive-ról
tar -xzf /mnt/usb/zorin-efi.tar.gz -C /mnt/efi

After that, all you have to do is set the boot order in bios and lock it.
I don’t know if there is any way to tweak it, actually with Zorin the manual grub.cfg editing bothers me (since it can’t find filesystems based on uuid), it doesn’t seem normal to be so fiddly with a Linux clone, maybe it has something to do with the fact that Zorin only boots without initramfs under Linbo…

The Zorin intird problem has been solved by the stable linbo kernel, so now Zorin works without grub.cfg editing, so I can clone these machines quite viably, and the buggy Lenevo efi firmware was an excellent exercise in eyebrow-raising muscle flexing.:muscle: