1

I am trying to debug an issue I have with fwupd, but first I want to understand what UEFI on my ThinkPad T470s is doing when I am trying to boot my Ubuntu 20.10.

This is what my /boot/efi contains:

/boot/efi/
└── EFI
    ├── BOOT
    │   ├── BOOTX64.EFI
    │   ├── fbx64.efi
    │   └── mmx64.efi
    └── ubuntu
        ├── BOOTX64.CSV
        ├── fw
        │   ├── fwupd-3b8c8162-188c-46a4-aec9-be43f1d65697.cap
        │   ├── fwupd-7a176688-0960-47ba-931b-7829849e8347.cap
        │   └── fwupd-d95d3ada-eef1-464f-8a2a-a11232b8556b.cap
        ├── fwupdx64.efi
        ├── grub.cfg
        ├── grubx64.efi
        ├── mmx64.efi
        └── shimx64.efi

I currently also have an older Ubuntu 16.04 installation and I am using an NVMe drive. My boot order is first "ubuntu", then my NVMe drive. When I boot my system, I get a warning System bootloader not found, initializing defaults.. My system then boots from the nvme device and GRUB allows me to boot both in Ubuntu 20.10 and Ubuntu 16.04.

It looks like my firmware boot options "Ubuntu" and "Linux-Firmware-Updater" cannot be loaded (it returns to the boot menu without showing any error), so I am trying to understand if my /EFI/ tree is normal or I have messed something up.

Is the structure of this tree normal? Should I have both EFI/BOOT and EFI/ubuntu? Am I doing something wrong?


Edit: details requested:

$ sudo efibootmgr -v
BootCurrent: 0019
Timeout: 0 seconds
BootOrder: 0000,0017,0010,0011,0012,0013,0018,001A,001B,001C,001D,001E,0001,0019
Boot0000* ubuntu    HD(3,MBR,0xff767ef,0x64bb800,0x100800)/File(\EFI\ubuntu\shimx64.efi)
Boot0001* Linux-Firmware-Updater    HD(3,MBR,0xff767ef,0x64bb800,0x100800)/File(\EFI\ubuntu\fwupdx64.efi)
Boot0010  Setup FvFile(721c8b66-426c-4e86-8e99-3457c46ab0b9)
Boot0011  Boot Menu FvFile(126a762d-5758-4fca-8531-201a7f57f850)
Boot0012  Diagnostic Splash Screen  FvFile(a7d8d9a6-6ab0-4aeb-ad9d-163e59a7a380)
Boot0013  Lenovo Diagnostics    FvFile(3f7e615b-0d45-4f80-88dc-26b234958560)
Boot0014  Startup Interrupt Menu    FvFile(f46ee6f4-4785-43a3-923d-7f786c3c8479)
Boot0015  Rescue and Recovery   FvFile(665d3f60-ad3e-4cad-8e26-db46eee9f1b5)
Boot0016  MEBx Hot Key  FvFile(ac6fd56a-3d41-4efd-a1b9-870293811a28)
Boot0019* NVMe0 VenMsg(bc7838d2-0f82-4d60-8316-c068ee79d25b,001c199932d94c4eae9aa0b6e98eb8a400)
# (removed a few non-important entries)

The UUID of EFI/ubuntu/grub.cfg does not seem to correspond to anything from the efibootmgr list:

$ sudo less /boot/efi/EFI/ubuntu/grub.cfg
search.fs_uuid 4be2c650-c96c-4823-a833-28d345042788 root 
set prefix=($root)'/boot/grub'
configfile $prefix/grub.cfg

The BOOT/bootx64.efi and EFI/ubuntu/shimx64.efi seem to be the same:

$ sudo md5sum /boot/efi/EFI/BOOT/bootx64.efi
78415fb8fb9b909f8029858113f1335f  /boot/efi/EFI/BOOT/bootx64.efi
$ sudo md5sum /boot/efi/EFI/ubuntu/shimx64.efi
78415fb8fb9b909f8029858113f1335f  /boot/efi/EFI/ubuntu/shimx64.efi

It also looks like I am using MBR, instead of GPT.

5
  • My 18.04 system has both EFI/Boot and EFI/ubuntu as yours does. However I also have EFI/ASUS and EFI/Microsoft directories (it is a dual-boot Asus computer). Both the ASUS and Microsoft directories have Boot subdirectories in them. Also, I do not have any firmware stuff in my EFI/ubuntu directory. Nov 22, 2020 at 14:02
  • 1
    The /EFI/Boot is the fallback or drive boot entry. The bootx64.efi in it is normally a copy of shimx64.efi from grub or may be Windows .efi boot file if system is Windows. What does this show? sudo efibootmgr -v. And your grub.cfg in /EFI/ubuntu should refer to ESP and then grub.cfg in /EFI/ubuntu should have UUID of last install. Does this look correct? sudo fwupdmgr get-devices
    – oldfred
    Nov 22, 2020 at 15:36
  • @oldfred I think you found a trail. The bootx64.efi is indeed a copy of shimx64.efi, but the UUID mentioned in /EFI/ububuntu/grub.cfg does not seem to correspond to anything from the efibootmgr list. What can I understand from this? (I added the related output to the post)
    – MakisH
    Nov 22, 2020 at 18:14
  • 1
    UEFI uses GUID/partUUID. You can see partuuid with this: lsblk -o name,mountpoint,label,size,fstype,uuid,partuuid | egrep -v "^loop" Then grub.cfg 3 line configfile UUID should refer to / partition (or /boot if separate). So compare efibootmgr -v to partUUID and compare UUID in grub.cfg in ESP to mount of / partition's UUID. Configfile is just to load full grub.cfg in /boot folder in your install. If showing MBR, not gpt, you did not use the recommended gpt partitioning with UEFI. Windows requires gpt, Ubuntu will let you use MBR, but really should not.
    – oldfred
    Nov 22, 2020 at 18:25
  • @oldfred indeed, I am using MBR (found it with sudo parted -l, where I see Partition Table: msdos), maybe this causes issues. This laptop never had Windows, I simply was not well-informed when I set it up. I should really just rebuild everything from scratch properly, based on GPT. Please go on and make a summary of this as an answer, so I can give you proper credit. :)
    – MakisH
    Nov 22, 2020 at 18:40

1 Answer 1

4

New hardware is UEFI based and then Ubuntu (and Windows if not pre-installed) should be installed in UEFI boot mode. Microsoft requires gpt partitioning for UEFI installs by vendors, but Ubuntu will allow UEFI install to MBR(msdos) partitioned drives, but probably should not.

You can see partitioning with these:

lsblk -o name,mountpoint,label,size,fstype,uuid,partuuid | egrep -v "^loop"
sudo parted -l

UEFI boots from UEFI boot entries, but to see details on which partition/files are used you can run this which shows GUID/partUUID of ESP - efi system partition:

sudo efibootmgr -v

Then in ESP is a 3 line /EFI/ubuntu/grub.cfg as configfile to load full grub.cfg in your install's / (root) partition (or /boot if separate partition).

ESP should have at least two folders, /EFI/Boot & /EFI/ubuntu. Windows adds /EFI/Microsoft. These folders contain boot files. The /EFI/Boot is a fallback or drive boot entry which is a copy of shimx64.efi from grub or if Windows, a copy of its bootmgfw.efi boot file.

So boot is UEFI, to ESP, to install.

https://en.wikipedia.org/wiki/EFI_system_partition

https://superuser.com/questions/496026/what-is-the-difference-in-boot-with-bios-and-boot-with-uefi

Example /EFI/ubuntu/grub.cfg

dual boot 14.04 / 17.04 lost grub menu

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.