Need to edit grubx64.efi and place in nvme0n1p1

Boot repair (latest version) says I need to move something controlled by GRUB from /dev/nvme0n1p8 to /dev/nvme0n1p1.

Boot problems have occured on both muy Lenovo 330 desktops with Win 11 preinstalled and I have added Ubuntu. Other PC s such as my Dell 7720 have not had same problem. I wouild appreciate step-by-step instructions on how to do what boot repair suggests.

Thank you,

John

Better to post the link to the Summary Report that Boot-Repair gives. It seems like you may have created a second ESP - efi system partition. Most systems only like one per drive. Normally Ubuntu/grub share the ESP that Windows has created if dual booting with Windows in UEFI boot mode. But correct ESP must also be mounted in fstab, by UUID. All those details will be in report so we can confirm your configuration and make correct suggestions on repair.

1 Like

Hello oldfred. Thank you for your reply. The most recent Boot Repair Summary Report is at:
Ubuntu Pastebin , I just checked the URL and the report is there. I still haven’t mastered GPT . John

Another point- most windows installations only create an EFI partition of about 100mb. To consistently boot with other o/s’s you will need a bigger partition. The Ubuntu install complains if the EFI partition is less than 300mb. The first partition on your boot drive should be the EFI partition to save any issues.

Tony.

Line 135: /efi/ubuntu/grubx64.efi is already in nvme0n1p1
Therefore, the thread title is not strictly correct

Line 297: nvme0n1p8 439644160 471334911 31690752 15.1G Linux filesystem
Line 352: 615.8M free with 91% used
Your Ubuntu OS is located in a very small 15.1GB partition with limited free space

Also, partition nvme0n1p7 ext4 has 100% free space

Why is nvme0n1p7 unused?
Why is your installation on nvme0n1p8 so small?

TPM enabled (ftpm and similar acronyms) and/or Device Guard on some Lenovo laptops/PCs prevent Ubuntu (and other Linux systems) from booting.

Is it enabled on your device?

That is a good point, and to help check that;

ls -la /lib/modules/`uname -r`/kernel/drivers/char/tpm

And I had to dig this out of mothballs: :smile:

[ -d "$(ls -d /sys/kernel/security/tpm* 2>/dev/null | head -1)" ] && \
    echo "TPM available" || echo "TPM missing"

Also dmesg is a good check:
A very short clip of mine:

sudo dmesg | grep -i tpm
[sudo] password for me: 
[    0.000000] efi: ACPI=0xcdffe000 ACPI 2.0=0xcdffe014 TPMFinalLog=0xcdf3f000 SMBIOS=0xcb70a000 SMBIOS 3.0=0xcb708000 MEMATTR=0xb57cf018 ESRT=0xb534fd18 MOKvar=0xcb87f000 INITRD=0xb5344518 RNG=0xcdf9d018 TPMEventLog=0xcdf94018 
[    0.004771] ACPI: TPM2 0x00000000CDFED000 00004C (v04 LENOVO CB-01    00000001 ACPI 00040000)
[    0.004816] ACPI: Reserving TPM2 table memory at [mem 0xcdfed000-0xcdfed04b]

Thank you for your help. I expanded the Ubuntu partition (nvme0n1p8) to 43 GB.

sudo dmesg | grep -i tpm gave:
sudo dmesg | grep -i tpm
[sudo] password for johnl: 
[    0.000000] efi: ACPI 2.0=0x9b0f8000 ACPI=0x9b0f8000 TPMFinalLog=0x9b1ce000 SMBIOS=0x9b8b4000 SMBIOS 3.0=0x9b8b3000 MEMATTR=0x977f3018 ESRT=0x97876018 INITRD=0x92737918 RNG=0x9b0f7018 TPMEventLog=0x89bc8018 
[    0.009413] ACPI: TPM2 0x000000009B1526E8 000034 (v04 LENOVO TC-M1V   00001770 AMI  00000000)
[    0.009451] ACPI: Reserving TPM2 table memory at [mem 0x9b1526e8-0x9b15271b]
[    0.534776] tpm_tis MSFT0101:00: 2.0 TPM (device-id 0x1B, rev-id 16)
[    4.387971] systemd[1]: systemd 256.5-2ubuntu3.1 running in system mode (+PAM +AUDIT +SELINUX +APPARMOR +IMA +SMACK +SECCOMP +GCRYPT -GNUTLS +OPENSSL +ACL +BLKID +CURL +ELFUTILS +FIDO2 +IDN2 -IDN +IPTC +KMOD +LIBCRYPTSETUP +LIBCRYPTSETUP_PLUGINS +LIBFDISK +PCRE2 +PWQUALITY +P11KIT +QRENCODE +TPM2 +BZIP2 +LZ4 +XZ +ZLIB +ZSTD +BPF_FRAMEWORK -XKBCOMMON +UTMP +SYSVINIT +LIBARCHIVE)
[    4.623369] systemd[1]: systemd-pcrextend.socket - TPM PCR Measurements was skipped because of an unmet condition check (ConditionSecurity=measured-uki).
[    4.623382] systemd[1]: systemd-pcrlock.socket - Make TPM PCR Policy was skipped because of an unmet condition check (ConditionSecurity=measured-uki).
[    4.637135] systemd[1]: systemd-pcrmachine.service - TPM PCR Machine ID Measurement was skipped because of an unmet condition check (ConditionSecurity=measured-uki).
[    4.637964] systemd[1]: systemd-tpm2-setup-early.service - Early TPM SRK Setup was skipped because of an unmet condition check (ConditionSecurity=measured-uki).
[    4.694574] systemd[1]: systemd-tpm2-setup.service - TPM SRK Setup was skipped because of an unmet condition check (ConditionSecurity=measured-uki).
johnl@john-30c7000yus:~$ 

What should I do next?   Systen is working so I can get my work done so I don't need an answer right now.
John

Is system booting? I do not see normal UEFI boot entries for either Windows nor Ubuntu.
Boot-Repair runs this, which shows UEFI boot entries.

sudo efibootmgr -v

note older versions need -v to see detail, but new version shows too much with -v.
As mentioned above, it may be Lenovo UEFI settings preventing correct entries being added, either with efibootmgr or Boot-Repair total reinstall of grub.

You also show this:

Script `/boot/grub/grub.cfg.new’

That says you have a typo in either /etc/default/grub or in grub’s scripts, if you edited them.
If you look at the grub.cfg.new it may tell you line with error to help track it down. I forgot a closing } in a boot stanza in 40_custom and it say error was on last line (it was in middle somewhere).

System is working, that’s good news

Next steps:-

  • Mark the thread as solved
  • Use the system
  • In the event of another problem, start a new thread
1 Like

Thank you to all for your help.

I will be off to another location for a few weeks so this Lenovo P330 system wiill be shut down for a while. While Ubuntu can be made to work, it requires several tries to get it to boot properly.

John