GRUB booting to terminal

So that is to say, while booted into my EOS I should run

Yes.

Yes. This will rebuild the Grub from “scratch” so to speak.

Is this different from repairing the grub/UEFI as in this article? Or is that worth trying as well, i.e. booting in with a liveiso and going through the chroot steps.

I have run

[morten@endeavour ~]$ sudo mv /etc/default/grub /etc/default/grub.old
[morten@endeavour ~]$ sudo mv /etc/grub.d/ /etc/grub.d.old
[morten@endeavour ~]$ sudo rm /boot/grub/grubenv 
[morten@endeavour ~]$ sudo grub-editenv /boot/grub/grubenv create
[morten@endeavour ~]$ sudo pacman -S grub
warning: grub-2:2.04-8 is up to date -- reinstalling
resolving dependencies...
looking for conflicting packages...

Packages (1) grub-2:2.04-8

Total Download Size:    6,74 MiB
Total Installed Size:  32,91 MiB
Net Upgrade Size:       0,00 MiB

:: Proceed with installation? [Y/n] y
:: Retrieving packages...
 grub-2:2.04-8-x86_64    6,7 MiB  1270 KiB/s 00:05 [----------------------] 100%
(1/1) checking keys in keyring                     [----------------------] 100%
(1/1) checking package integrity                   [----------------------] 100%
(1/1) loading package files                        [----------------------] 100%
(1/1) checking for file conflicts                  [----------------------] 100%
:: Processing package changes...
(1/1) reinstalling grub                            [----------------------] 100%
:: Running post-transaction hooks...
(1/3) Arming ConditionNeedsUpdate...
(2/3) Fix 'grub' and 'os-prober' after upgrading either of them.
===> INFO: grub-tools / grub-fix-initrd-generation:
===> INFO: /etc/grub.d/30_os-prober changed. See file /var/log/grub-fix-initrd-generation.log.
===> INFO: /etc/grub.d/10_linux changed. See file /var/log/grub-fix-initrd-generation.log.
===> INFO: /etc/default/grub changed. See file /var/log/grub-fix-initrd-generation.log.
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-linux
Found initrd image: /boot/amd-ucode.img /boot/initramfs-linux.img
Found fallback initrd image(s) in /boot: initramfs-linux-fallback.img
Found Windows Boot Manager on /dev/nvme0n1p1@/EFI/Microsoft/Boot/bootmgfw.efi
done
(3/3) Updating the info directory file...
[morten@endeavour ~]$ sudo grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=EndeavourOS-new
Installing for x86_64-efi platform.
Installation finished. No error reported.
[morten@endeavour ~]$ sudo grub-mkconfig -o /boot/grub/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-linux
Found initrd image: /boot/amd-ucode.img /boot/initramfs-linux.img
Found fallback initrd image(s) in /boot: initramfs-linux-fallback.img
Found Windows Boot Manager on /dev/nvme0n1p1@/EFI/Microsoft/Boot/bootmgfw.efi
done

and will try rebooting now.

After rebooting:
IMG_20210131_132257
IMG_20210131_132331

So @pebcak still the same problem, except grub has now lost its styling.

If removing with efibootmgr doesn’t help, you might be able to delete the unnecessary entries in your UEFI BIOS. How to do it depends on your motherboard.

According to efibootmgr -v

[morten@endeavour ~]$ efibootmgr -v
BootCurrent: 0001
Timeout: 2 seconds
BootOrder: 0001,0000,0016,0017,0018,0019,001A,001B
Boot0000* Windows Boot Manager	HD(1,GPT,a81c3d6d-f2e2-4afb-a30f-910107a4854a,0x800,0x100000)/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.}....................
Boot0001* ubuntu	HD(1,GPT,a81c3d6d-f2e2-4afb-a30f-910107a4854a,0x800,0x100000)/File(\EFI\ubuntu\shimx64.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* USB CD	VenMsg(bc7838d2-0f82-4d60-8316-c068ee79d25b,86701296aa5a7848b66cd49dd3ba6a55)
Boot0017* USB FDD	VenMsg(bc7838d2-0f82-4d60-8316-c068ee79d25b,6ff015a28830b543a8b8641009461e49)
Boot0018* NVMe0	VenMsg(bc7838d2-0f82-4d60-8316-c068ee79d25b,001c199932d94c4eae9aa0b6e98eb8a400)
Boot0019* ATA HDD0	VenMsg(bc7838d2-0f82-4d60-8316-c068ee79d25b,91af625956449f41a7b91f4f892ab0f600)
Boot001A* USB HDD	VenMsg(bc7838d2-0f82-4d60-8316-c068ee79d25b,33e821aaaf33bc4789bd419f88c50803)
Boot001B* PCI LAN	VenMsg(bc7838d2-0f82-4d60-8316-c068ee79d25b,78a84aaf2b2afc4ea79cf5cc8f3d3803)
Boot001C  Regulatory Information	FvFile(e4a83242-deee-f12e-15ff-0102036cc3ce)

I think the extra entries should be removed right? At least there is not the ubuntu entry anymore.

That’s odd! I am a bit at a loss to understand wherein the problem lies.

The Ubuntu boot entry is still in your output and none for EnOS!

:thinking:

Do you have any advice on how to do this for a thinkpad E495?

I just noticed this as well, how should I proceed? Is there a way to reset the efi entries?

@pebcak @joekamprad @manuel I think I may have made some progress by combining suggestions.

Looking at the boot settings from the BIOS I noticed ubuntu in the queue
IMG_20210131_135733
I figured this was wrong and guessed that NVMe0... was instead my efi partition, i.e. /dev/nvme0n1p1 when looking at fdisk -l

[morten@endeavour ~]$ sudo fdisk -l
Disk /dev/nvme0n1: 238,47 GiB, 256060514304 bytes, 500118192 sectors
Disk model: UMIS RPJTJ256MED1OWX                    
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 834F0338-D057-4A71-B7BD-31D49B937976

Device             Start       End   Sectors   Size Type
/dev/nvme0n1p1      2048   1050623   1048576   512M EFI System
/dev/nvme0n1p2   1050624 304760831 303710208 144,8G Linux filesystem
/dev/nvme0n1p3 304760832 500117503 195356672  93,2G Microsoft basic data
[morten@endeavour ~]$ 

As such I moved this EFI partition to the top and deleted the ubuntu partition, after rebooting I was put directly into image so I figure this was at least partly successful.

The final remaining thing is that efibootmgr -v still has no entry for eos as it did for me in an earlier post.

[morten@endeavour ~]$ efibootmgr -v
BootCurrent: 0018
Timeout: 2 seconds
BootOrder: 0018,0000,0016,0017,0019,001A,001B
Boot0000* Windows Boot Manager	HD(1,GPT,a81c3d6d-f2e2-4afb-a30f-910107a4854a,0x800,0x100000)/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.}....................
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* USB CD	VenMsg(bc7838d2-0f82-4d60-8316-c068ee79d25b,86701296aa5a7848b66cd49dd3ba6a55)
Boot0017* USB FDD	VenMsg(bc7838d2-0f82-4d60-8316-c068ee79d25b,6ff015a28830b543a8b8641009461e49)
Boot0018* NVMe0	VenMsg(bc7838d2-0f82-4d60-8316-c068ee79d25b,001c199932d94c4eae9aa0b6e98eb8a400)
Boot0019* ATA HDD0	VenMsg(bc7838d2-0f82-4d60-8316-c068ee79d25b,91af625956449f41a7b91f4f892ab0f600)
Boot001A* USB HDD	VenMsg(bc7838d2-0f82-4d60-8316-c068ee79d25b,33e821aaaf33bc4789bd419f88c50803)
Boot001B* PCI LAN	VenMsg(bc7838d2-0f82-4d60-8316-c068ee79d25b,78a84aaf2b2afc4ea79cf5cc8f3d3803)
Boot001C  Regulatory Information	FvFile(e4a83242-deee-f12e-15ff-0102036cc3ce)
[morten@endeavour ~]$ 

But I suppose this is due to some of the attempts to fix the problem we have attempted along the way.

I suppose all that is left is: Is it a problem that efibootmgr -v doesn’t return an EOS anymore, and if so how can I go about fixing this?

1 Like

Personally, I would leave it as is now since boot entry 0018 seems to be pointing to correct boot files (Endeavour’s) and your system is bootable and working.

However, it is possible to add another boot entry for EnOS manually using efibootmgr command line and see if that will work as well.

1 Like

The only items you need in the boot order are the ones you want or typically would boot from. First priority would be the drive you have the OS installed to that you want to boot from. Linux as Grub is controlling the boot for both EndeavourOS and Windows. The second priority would boot from Windows. Then it would be boot from other devices such as usb or cd/dvd etc. You don’t need everything that’s in the list. I would remove them and only have 3 or 4 entries. Then fix the grub by either reinstalling it to the proper drive that EndeavourOS is on and running the update grub command.

Edit: The boot priority can be changed and set in the UEFI Bios screen but you can remove the entries using evibootmgr in Linux.

Okay that makes sense. One small question I have, I know that I can create an eos entry in efibootmgr -v by writing

sudo grub-mkconfig -o /boot/grub/grub.cfg
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=EndeavourOS-grub

and this add the EndeavourOS-grub bootloader ID to the efibootmgr, but as soon as a restart in order to configure the boot order it disappears. How can I make this change persist?

You should be doing the grub update command after not first.

sudo grub-mkconfig -o /boot/grub/grub.cfg

Edit: Not sure if that is what you are doing?

Okay then I’ve been doing it backwards, just tried running

grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=EndeavourOS-grub
sudo grub-mkconfig -o /boot/grub/grub.cfg

By checking efibootmgr -v I saw it succesfully added the EndeavourOS-grub entry. Then I rebooted and it was gone. So the aforementioned problem is still there.

If you like you could make a boot entry manually and see if it will work:

sudo efibootmgr -c -d /dev/nvme0n1 -p 1 -L EndeavourOS -l '\EFI\EndeavourOS-grub\grubx64.efi'

When you rebooted what was gone? Did it not boot to the grub menu? Is it booting from the drive you have EndeavourOS installed? I would go with what @pebcak has shown.