1

After using timeshift to restore a previous snapshot, the grub now boots into command line. If I type the following commands I can get back to Ubuntu (KDE neon):

> set prefix=(hd0,gpt1)/efi/grub (or "set prefix=(hd0,gpt1)/efi/neon" both works)
> set root=(hd0,gpt4)/
> insmod normal
> normal

Unfortunately I should type those commands every time and I can't figure out how to repair it. I've tried running:

sudo update-grub
sudo grub-install /dev/nvme0n1

I've also tried running Boot-repair but no luck. If I change the boot order to windows on the bios, I can boot to it without any issue.

Below is the output of the boot-info command:

boot-info-4ppa203                                              [20230304_1957]

============================== Boot Info Summary ===============================

 => No boot loader is installed in the MBR of /dev/nvme0n1.
 => No boot loader is installed in the MBR of /dev/nvme1n1.

nvme0n1p1: _____________________________________________________________________

    File system:       vfat
    Boot sector type:  Windows 8/10/11/2012: FAT32
    Boot sector info:  No errors found in the Boot Parameter Block.
    Operating System:  
    Boot files:        /efi/Boot/bkpbootx64.efi /efi/Boot/bootx64.efi 
                       /efi/Boot/fbx64.efi /efi/Boot/mmx64.efi 
                       /efi/grub/grubx64.efi /efi/grub/mmx64.efi 
                       /efi/grub/shimx64.efi /efi/neon/grubx64.efi 
                       /efi/neon/mmx64.efi /efi/neon/shimx64.efi 
                       /efi/grub/grub.cfg /efi/neon/grub.cfg 
                       /efi/ubuntu/grub.cfg /efi/Microsoft/Boot/bootmgfw.efi 
                       /efi/Microsoft/Boot/bootmgr.efi

nvme0n1p2: _____________________________________________________________________

    File system:       
    Boot sector type:  -
    Boot sector info: 

nvme0n1p3: _____________________________________________________________________

    File system:       ntfs
    Boot sector type:  Windows 8/10/11/2012: NTFS
    Boot sector info:  No errors found in the Boot Parameter Block.
    Operating System:  Windows 10 or 11
    Boot files:        /Windows/System32/winload.exe

nvme0n1p4: _____________________________________________________________________

    File system:       ext4
    Boot sector type:  -
    Boot sector info: 
    Operating System:  KDE neon User - 5.26
    Boot files:        /boot/grub/grub.cfg /etc/fstab /etc/default/grub

nvme0n1p5: _____________________________________________________________________

    File system:       ext4
    Boot sector type:  -
    Boot sector info: 
    Operating System:  
    Boot files:        

nvme1n1p1: _____________________________________________________________________

    File system:       ntfs
    Boot sector type:  Windows 8/10/11/2012: NTFS
    Boot sector info:  No errors found in the Boot Parameter Block.
    Operating System:  
    Boot files:        


================================ 2 OS detected =================================

OS#1:   KDE neon User - 5.26 on nvme0n1p4
OS#2:   Windows 10 or 11 on nvme0n1p3

================================ Host/Hardware =================================

CPU architecture: 64-bit
Video: NVIDIA Corporation Advanced Micro Devices, Inc. [AMD/ATI] from NVIDIA Corporation Advanced Micro Devices, Inc. [AMD/ATI]
BOOT_IMAGE of the installed session in use:
/boot/vmlinuz-6.0.9-060009-generic root=UUID=b386cc7c-a076-48b9-bdf7-86fe3af5136c ro quiet splash vt.handoff=7
df -Th / : /dev/nvme0n1p4 ext4   98G   55G   39G  59% /

===================================== UEFI =====================================

BIOS/UEFI firmware: GKCN59WW(1.59) from LENOVO
The firmware is EFI-compatible, and is set in EFI-mode for this installed-session.
SecureBoot disabled (confirmed by mokutil).
BootCurrent: 0004
Timeout: 0 seconds
BootOrder: 0004,2001,0000,0005,2002,2003
Boot0000* Windows Boot Manager  HD(1,GPT,f9f3fec7-bd7d-4ef5-afbf-633df4359ff0,0x800,0xfa000)/File(\EFI\Microsoft\Boot\bootmgfw.efi)RC
Boot0002* EFI PXE 0 for IPv6 (88-A4-C2-A6-A1-D5)    PciRoot(0x0)/Pci(0x2,0x1)/Pci(0x0,0x0)/MAC(88a4c2a6a1d5,0)/IPv6([::]:<->[::]:,0,0)RC
Boot0003* EFI PXE 0 for IPv4 (88-A4-C2-A6-A1-D5)    PciRoot(0x0)/Pci(0x2,0x1)/Pci(0x0,0x0)/MAC(88a4c2a6a1d5,0)/IPv4(0.0.0.00.0.0.0,0,0)RC
Boot0004* grub  HD(1,GPT,f9f3fec7-bd7d-4ef5-afbf-633df4359ff0,0x800,0xfa000)/File(\EFI\grub\shimx64.efi)
Boot0005* ke    HD(1,GPT,f9f3fec7-bd7d-4ef5-afbf-633df4359ff0,0x800,0xfa000)/File(\EFI\neon\grubx64.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................
Boot2001* EFI USB Device    RC
Boot2002* EFI DVD/CDROM RC
Boot2003* EFI Network   RC


============================= Drive/Partition Info =============================

Disks info: ____________________________________________________________________

nvme0n1 : is-GPT,   no-BIOSboot,    has---ESP,  not-usb,    not-mmc, has-os,    has-win,    2048 sectors * 512 bytes
nvme1n1 : is-GPT,   no-BIOSboot,    has-noESP,  not-usb,    not-mmc, no-os, no-wind,    2048 sectors * 512 bytes

Partitions info (1/3): _________________________________________________________

nvme0n1p4   : is-os,    64, apt-get,    signed grub-pc grub-efi ,   grub2,  grub-install,   grubenv-ok, update-grub,    farbios
nvme1n1p1   : no-os,    64, nopakmgr,   no-docgrub, nogrub, nogrubinstall,  no-grubenv, noupdategrub,   farbios
nvme0n1p1   : no-os,    64, nopakmgr,   no-docgrub, nogrub, nogrubinstall,  no-grubenv, noupdategrub,   not-far
nvme0n1p3   : is-os,    64, nopakmgr,   no-docgrub, nogrub, nogrubinstall,  no-grubenv, noupdategrub,   not-far
nvme0n1p5   : no-os,    64, nopakmgr,   no-docgrub, nogrub, nogrubinstall,  no-grubenv, noupdategrub,   farbios

Partitions info (2/3): _________________________________________________________

nvme0n1p4   : isnotESP, fstab-has-goodEFI,  no-nt,  no-winload, no-recov-nor-hid,   no-bmgr,    notwinboot
nvme1n1p1   : isnotESP, part-has-no-fstab,  no-nt,  no-winload, no-recov-nor-hid,   no-bmgr,    notwinboot
nvme0n1p1   : is---ESP, part-has-no-fstab,  no-nt,  no-winload, no-recov-nor-hid,   no-bmgr,    notwinboot
nvme0n1p3   : isnotESP, part-has-no-fstab,  no-nt,  haswinload, no-recov-nor-hid,   no-bmgr,    notwinboot
nvme0n1p5   : isnotESP, part-has-no-fstab,  no-nt,  no-winload, no-recov-nor-hid,   no-bmgr,    notwinboot

Partitions info (3/3): _________________________________________________________

nvme0n1p4   : not--sepboot, with-boot,  fstab-without-boot, not-sep-usr,    with--usr,  fstab-without-usr,  std-grub.d, nvme0n1
nvme1n1p1   : not--sepboot, no---boot,  part-has-no-fstab,  not-sep-usr,    no---usr,   part-has-no-fstab,  no--grub.d, nvme1n1
nvme0n1p1   : not--sepboot, no---boot,  part-has-no-fstab,  not-sep-usr,    no---usr,   part-has-no-fstab,  no--grub.d, nvme0n1
nvme0n1p3   : not--sepboot, no---boot,  part-has-no-fstab,  not-sep-usr,    no---usr,   part-has-no-fstab,  no--grub.d, nvme0n1
nvme0n1p5   : maybesepboot, no---boot,  part-has-no-fstab,  not-sep-usr,    no---usr,   part-has-no-fstab,  no--grub.d, nvme0n1

fdisk -l (filtered): ___________________________________________________________

Disk nvme1n1: 931.53 GiB, 1000204886016 bytes, 1953525168 sectors
Disk identifier: 41D0A58A-BCCA-4999-AE9C-77ED139B7F5D
          Start        End    Sectors   Size Type
nvme1n1p1  2048 1953523711 1953521664 931.5G Microsoft basic data
Disk nvme0n1: 476.96 GiB, 512110190592 bytes, 1000215216 sectors
Disk identifier: 41BFB7F3-AF8C-41C5-9190-2DB7078D13D7
              Start        End   Sectors   Size Type
nvme0n1p1      2048    1026047   1024000   500M EFI System
nvme0n1p2   1026048    1058815     32768    16M Microsoft reserved
nvme0n1p3   1058816  135243775 134184960    64G Microsoft basic data
nvme0n1p4 135243776  344958975 209715200   100G Linux filesystem
nvme0n1p5 344958976 1000215182 655256207 312.5G Linux filesystem

parted -lm (filtered): _________________________________________________________

nvme0n1:512GB:nvme:512:512:gpt:SAMSUNG MZVLB512HBJQ-000L2:;
1:1049kB:525MB:524MB:fat32:EFI System Partition:boot, esp;
2:525MB:542MB:16.8MB::Microsoft reserved partition:msftres;
3:542MB:69.2GB:68.7GB:ntfs:Windows:msftdata;
4:69.2GB:177GB:107GB:ext4::;
5:177GB:512GB:335GB:ext4::;
nvme1n1:1000GB:nvme:512:512:gpt:T-CREATE TM8FPH001T:;
1:1049kB:1000GB:1000GB:ntfs:Basic data partition:msftdata;

blkid (filtered): ______________________________________________________________

NAME        FSTYPE UUID                                 PARTUUID                             LABEL  PARTLABEL
nvme1n1                                                                                             
└─nvme1n1p1 ntfs   EC84F84484F812B6                     30897a30-bc92-4dd4-95c7-197c6a9c1507 Assets Basic data partition
nvme0n1                                                                                             
├─nvme0n1p1 vfat   02F8-E8D1                            f9f3fec7-bd7d-4ef5-afbf-633df4359ff0        EFI System Partition
├─nvme0n1p2                                             dcc345ec-1019-4035-a464-2f89c1271e3b        Microsoft reserved partition
├─nvme0n1p3 ntfs   34ACF8C4ACF881A2                     5f35bfa4-31c9-4038-b18f-a6c7df590937        Windows
├─nvme0n1p4 ext4   b386cc7c-a076-48b9-bdf7-86fe3af5136c 5d681f33-e946-7e4a-b80a-9b02561aacfc        
└─nvme0n1p5 ext4   1fb6f877-742b-467e-bcb6-96c3f097a920 a1c0e888-2eb2-c547-953c-3dbc1a0b413f        

Mount points (filtered): _______________________________________________________

                           Avail Use% Mounted on
/dev/nvme0n1p3             18.5G  71% /mnt/boot-sav/nvme0n1p3
/dev/nvme0n1p4             38.8G  55% /
/dev/nvme0n1p5             83.3G  68% /home
/dev/nvme1n1p1             27.8G  97% /media/razor/Assets
/dev/nvme1n1p1[/Documents] 27.8G  97% /home/razor/Documents
/dev/nvme1n1p1[/Music]     27.8G  97% /home/razor/Music
/dev/nvme1n1p1[/Pictures]  27.8G  97% /home/razor/Pictures
/dev/nvme1n1p1[/Videos]    27.8G  97% /home/razor/Videos

Mount options (filtered): ______________________________________________________


==================== nvme0n1p1/efi/grub/grub.cfg (filtered) ====================

search.fs_uuid b386cc7c-a076-48b9-bdf7-86fe3af5136c root 
set prefix=($root)'/boot/grub'
configfile $prefix/grub.cfg

==================== nvme0n1p1/efi/neon/grub.cfg (filtered) ====================

search.fs_uuid 466639e3-84e8-470b-84da-98a7ca9396f2 root 
set prefix=($root)'/boot/grub'
configfile $prefix/grub.cfg

=================== nvme0n1p1/efi/ubuntu/grub.cfg (filtered) ===================

search.fs_uuid 466639e3-84e8-470b-84da-98a7ca9396f2 root 
set prefix=($root)'/boot/grub'
configfile $prefix/grub.cfg

=================== nvme0n1p4/boot/grub/grub.cfg (filtered) ====================

GNU/Linux   b386cc7c-a076-48b9-bdf7-86fe3af5136c
GNU/Linux, with Linux 6.0.9-060009-generic   b386cc7c-a076-48b9-bdf7-86fe3af5136c
GNU/Linux, with Linux 6.0.7-060007-generic   b386cc7c-a076-48b9-bdf7-86fe3af5136c
GNU/Linux, with Linux 5.19.12-051912-generic   b386cc7c-a076-48b9-bdf7-86fe3af5136c
GNU/Linux, with Linux 5.19.9-051909-generic   b386cc7c-a076-48b9-bdf7-86fe3af5136c
GNU/Linux, with Linux 5.19.7-051907-generic   b386cc7c-a076-48b9-bdf7-86fe3af5136c
GNU/Linux, with Linux 5.19.5-051905-generic   b386cc7c-a076-48b9-bdf7-86fe3af5136c
GNU/Linux, with Linux 5.19.3-051903-generic   b386cc7c-a076-48b9-bdf7-86fe3af5136c
GNU/Linux, with Linux 5.19.1-051901-generic   b386cc7c-a076-48b9-bdf7-86fe3af5136c
GNU/Linux, with Linux 5.19-051900-generic   b386cc7c-a076-48b9-bdf7-86fe3af5136c
GNU/Linux, with Linux 5.4.0-135-generic   b386cc7c-a076-48b9-bdf7-86fe3af5136c
GNU/Linux, with Linux 5.4.0-131-generic   b386cc7c-a076-48b9-bdf7-86fe3af5136c
Windows Boot Manager (on nvme0n1p1)   osprober-efi-02F8-E8D1
### END /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_uefi-firmware ###

======================== nvme0n1p4/etc/fstab (filtered) ========================

# <file system> <mount point> <type> <options> <dump> <pass>
UUID=b386cc7c-a076-48b9-bdf7-86fe3af5136c   /   ext4    defaults,noatime    0   1
UUID=1fb6f877-742b-467e-bcb6-96c3f097a920   /home   ext4    defaults,noatime    0   2
UUID=EC84F84484F812B6   /media/razor/Assets ntfs3   noatime,uid=1000,gid=1000,fmask=0112,dmask=0002,rw,iocharset=utf8   0   0
/media/razor/Assets/Pictures    /home/razor/Pictures    auto    defaults,nofail,nobootwait,bind 0   2
/media/razor/Assets/Music   /home/razor/Music   auto    defaults,nofail,nobootwait,bind 0   2
/media/razor/Assets/Videos  /home/razor/Videos  auto    defaults,nofail,nobootwait,bind 0   2
/media/razor/Assets/Documents   /home/razor/Documents   auto    defaults,nofail,nobootwait,bind 0   2
UUID=02F8-E8D1  /boot/efi       vfat    defaults      0       1

==================== nvme0n1p4/etc/default/grub (filtered) =====================

GRUB_DEFAULT=0
GRUB_TIMEOUT_STYLE=menu
GRUB_TIMEOUT=10
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""
GRUB_DISABLE_OS_PROBER=false

================= nvme0n1p4: Location of files loaded by Grub ==================

           GiB - GB             File                                 Fragment(s)
 126.663829803 = 136.004251648  boot/grub/grub.cfg                             4
 128.473628998 = 137.947508736  boot/vmlinuz                                   2
 112.476821899 = 120.771067904  boot/vmlinuz-5.19-051900-generic               1
 112.523818970 = 120.821530624  boot/vmlinuz-5.19.1-051901-generic             2
 128.375267029 = 137.841893376  boot/vmlinuz-5.19.12-051912-generic            1
 128.387691498 = 137.855234048  boot/vmlinuz-5.19.3-051903-generic             2
 128.398700714 = 137.867055104  boot/vmlinuz-5.19.5-051905-generic             1
 128.411128998 = 137.880399872  boot/vmlinuz-5.19.7-051907-generic             2
 128.422142029 = 137.892225024  boot/vmlinuz-5.19.9-051909-generic             1
 128.439483643 = 137.910845440  boot/vmlinuz-5.4.0-131-generic                 1
 128.455112457 = 137.927626752  boot/vmlinuz-5.4.0-135-generic                 1
 128.465816498 = 137.939120128  boot/vmlinuz-6.0.7-060007-generic              2
 128.473628998 = 137.947508736  boot/vmlinuz-6.0.9-060009-generic              2
 128.455112457 = 137.927626752  boot/vmlinuz.old                               1
 157.724925995 = 169.355849728  boot/initrd.img                                1
  80.364151001 = 86.290350080   boot/initrd.img-5.19-051900-generic            1
  76.364162445 = 81.995395072   boot/initrd.img-5.19.1-051901-generic          1
 144.364200592 = 155.009880064  boot/initrd.img-5.19.12-051912-generic         1
 160.364177704 = 172.189724672  boot/initrd.img-5.19.3-051903-generic          1
 158.864253998 = 170.579193856  boot/initrd.img-5.19.5-051905-generic          2
 157.176685333 = 168.767180800  boot/initrd.img-5.19.7-051907-generic          1
 157.301689148 = 168.901402624  boot/initrd.img-5.19.9-051909-generic          1
 157.383125305 = 168.988844032  boot/initrd.img-5.4.0-131-generic              1
 157.465816498 = 169.077633024  boot/initrd.img-5.4.0-135-generic              2
 157.592098236 = 169.213227008  boot/initrd.img-6.0.7-060007-generic           1
 157.724925995 = 169.355849728  boot/initrd.img-6.0.9-060009-generic           1
 157.465816498 = 169.077633024  boot/initrd.img.old                            2

=================== nvme0n1p4: ls -l /etc/grub.d/ (filtered) ===================

-rwxr-xr-x. 1 root root 18224 Jan 11  2022 10_linux
-rwxr-xr-x. 1 root root 42359 Aug 12  2021 10_linux_zfs
-rwxr-xr-x. 1 root root 12894 Aug 12  2021 20_linux_xen
-rwxr-xr-x. 1 root root 12059 Aug 12  2021 30_os-prober
-rwxr-xr-x. 1 root root  1424 Aug 12  2021 30_uefi-firmware
-rwxr-xr-x. 1 root root   700 Feb 21  2022 35_fwupd
-rwxr-xr-x. 1 root root   214 Aug 12  2021 40_custom
-rwxr-xr-x. 1 root root   216 Aug 12  2021 41_custom



Suggested repair: ______________________________________________________________

The default repair of the Boot-Repair utility would reinstall the grub-efi of
nvme0n1p4,
using the following options:  nvme0n1p1/boot/efi
Additional repair would be performed: unhide-bootmenu-10s use-standard-efi-file restore-efi-backups

Final advice in case of suggested repair: ______________________________________

Please do not forget to make your UEFI firmware boot on the KDE neon User - 5.26 entry (nvme0n1p1/efi/****/grub****.efi (**** will be updated in the final message) file) !
If your computer reboots directly into Windows, try to change the boot order in your UEFI firmware.
If your UEFI firmware does not allow to change the boot order, change the default boot entry of the Windows bootloader.
For example you can boot into Windows, then type the following command in an admin command prompt:
bcdedit /set {bootmgr} path \EFI\****\grub****.efi (**** will be updated in the final message)
0

1 Answer 1

2

Both nvme0n1p1/efi/neon/grub.cfg and nvme0n1p1/efi/ubuntu/grub.cfg refer to a filesystem with UUID 466639e3-84e8-470b-84da-98a7ca9396f2, which does not seem to exist on the system any more. At least those UUIDs should be replaced with valid ones, since they are useless in their current form.

The efibootmgr -v output within the Boot-Repair printout indicates that the UEFI boot option Boot0004 is the currently active one and also the one with the first place in BootOrder, and it refers to \EFI\grub\shimx64.efi on the partition with PARTUUID f9f3fec7-bd7d-4ef5-afbf-633df4359ff0, which is nvme0n1p1.

As a brute-force fix, you could edit nvme0n1p1/efi/grub/grub.cfg to more or less match the commands you had discovered:

set prefix=(hd0,gpt1)/efi/grub
set root=(hd0,gpt4)
configfile $root/boot/grub/grub.cfg
# or maybe "insmod normal" and then "normal", just like you did...

Or you could try this version to be more forgiving of future configuration changes:

search.fs_uuid 02F8-E8D1 root       # search for nvme0n1p1 by FS UUID
set prefix=($root)'/efi/grub'       # sets the prefix using the root
search.fs_uuid b386cc7c-a076-48b9-bdf7-86fe3af5136c root   # find nvme0n1p4 by FS UUID
# maybe "insmod normal" and then "normal" here, or...
configfile $root/boot/grub/grub.cfg

Background: Initially shimx64.efi starts grubx64.efi in the same directory on the EFI System Partition (which on your system is nvme0n1p1). It first reads a mini-grub.cfg in the same directory it itself is located, and this is used on modern Debian and derivatives (and increasingly on other distributions too) to just identify where the main /boot/grub directory is. Usually it would be on a root filesystem or a dedicated /boot filesystem (if the root filesystem is encrypted or placed on LVM, RAID or similar that GRUB cannot read).

But in your case, your EFI System Partition seems to include an /efi/grub directory that seems to be usable as a GRUB prefix (i.e. the place to load more GRUB modules from). Or it might be a red herring: given that your setup includes the shimx64.efi, to fulfill the Secure Boot requirements, all the necessary GRUB modules must be already built in to the main grubx64.efi binary, as GRUB won't actually be able to load any modules if Secure Boot is in effect.

(The Secure Boot firmware will enforce the restriction that anything loaded into memory will be marked non-executable, unless it comes from a validly signed Windows-style PE+ binary file. GRUB modules are ELF-formatted binary files, not PE+, so they cannot satisfy this requirement. But the main grubx64.efi is a PE+ file and it can include ELF modules built into it before signing.)

Your actual "main" GRUB configuration that includes your boot menu definition lives in /boot/grub/grub.cfg as viewed from your root filesystem, which is apparently nvme0n1p4. But GRUB can "look" at only one filesystem at a time, and the $root variable is normally used to designate the filesystem GRUB will be accessing.

1
  • Huge thanks the explanation! Unfortunately, neither the brute-force nor the future proofing fix works (I had to add / at the end of set root=(hd0,gpt4) in nvme0n1p1/efi/grub/grub.cfg because it won't work without it on the command line, I've also tested both configfile and insmode). I did delete the nvme0n1p4 partition and reformat it, that's why both neon and ubuntu refers to an old UUID, the efi/grub folder was generated by Boot-repair btw. Even though nvme0n1p1/efi/neon/grub.cfg refers to an old UUID I still can boot the the OS with set prefix=(hd0,gpt1)/efi/neon
    – Razor
    Mar 10, 2023 at 16:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .