GRUB restore problem finding the OS

(I hope the category is right)

Hello to everyone, I have problems restoring GRUB after a Windows update, and now I can’t boot into Manjaro but only in Windows choosing its partition from the boot menu in UEFI.

I tried following the guide on the Manjaro Wiki using a Live USB about restoring GRUB named " GRUB/Restore the GRUB Bootloader" (i can’t include links since I just created this account because I lost my old one).
But when i run grub-mkconfig -o /boot/grub/grub.cfg it doesn’t find Manjaro and Windows. Now I will write everything I did so it can be more undestandable.

My ssd partitions, using lsblk, is
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
loop0 7:0 0 76,9M 1 loop /run/miso/sfs/livefs
loop1 7:1 0 219,9M 1 loop /run/miso/sfs/mhwdfs
loop2 7:2 0 1G 1 loop /run/miso/sfs/desktopfs
loop3 7:3 0 630,2M 1 loop /run/miso/sfs/rootfs
sda 8:0 0 1,8T 0 disk
└─sda1 8:1 0 1,8T 0 part
sdb 8:16 0 476,9G 0 disk
├─sdb1 8:17 0 100M 0 part
├─sdb2 8:18 0 128M 0 part
├─sdb3 8:19 0 16M 0 part
├─sdb4 8:20 0 354,8G 0 part
├─sdb5 8:21 0 552M 0 part
├─sdb6 8:22 0 120,8G 0 part
└─sdb7 8:23 0 499M 0 part
sdc 8:32 1 14,8G 0 disk /run/miso/bootmnt
├─sdc1 8:33 1 2G 0 part
└─sdc2 8:34 1 4M 0 part

So I have the EFI partition in sdb1 and the Linux system is in sdb6. The others are the Windows System and other Windows reserved partitions.

I mounted the Linux partition and the EFI partition in /mnt and /mnt/boot/efi like the guide says.

I then used manjaro-chroot /mnt /bin/bash to chroot into the system.
I reinstalled Grub using pacman -S grub and also updated every application installed.

After this, i installed grub using
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=manjaro --recheck
and it says “Installation finished. No error reported”.
I finally run grub-mkconfig -o /boot/grub/grub.cfg
and it gives me this output:

Generating grub configuration file …
Found theme: /usr/share/grub/themes/manjaro/theme.txt
grub-probe: error: cannot find a GRUB drive for /dev/sdc1. Check your device.map.
grub-probe: error: cannot find a GRUB drive for /dev/sdc1. Check your device.map.
Adding boot menu entry for UEFI Firmware Settings …
Found memtest86+ image: /boot/memtest86+/memtest.bin
done

and rebooting the PC, GRUB will start but there are no OS in the list.

As you can see, it only finds the Manjaro theme and “memtest”, but no Manjaro or Windows 10. I think it’s searching into the USB stick and not into the SSD, because in the output it says “cannot find GRUB drive for /dev/sdc1”, and sdc is the USB stick.

Also running update-grub it gives me the same output.

After searching on the web, I saw that someone says that I need to run os-prober. And I saw that running it in the chroot, it gives me this output:

grub-probe: error: cannot find a GRUB drive for /dev/sdc1. Check your device.map.
grub-probe: error: cannot find a GRUB drive for /dev/sdc1. Check your device.map.

But running it after exiting chroot, it gives me this output:

/dev/sdb1@/EFI/Microsoft/Boot/bootmgfw.efi:Windows Boot Manager:Windows:efi
/dev/sdb6:Manjaro Linux (20.2):ManjaroLinux:linux
grub-probe: errore: impossibile trovare un’unità GRUB per /dev/sdc1, controllare device.map.
grub-probe: errore: impossibile trovare un’unità GRUB per /dev/sdc1, controllare device.map.

And here it is finding both Manjaro and Windows.

Anyone has some ideas about how to make grub put this into the boot menu list?

Hello @Kliffom :wink:
Did you mount efivarfs in chroot?

mount -t efivarfs efivarfs /sys/firmware/efi/efivars

https://wiki.manjaro.org/index.php/GRUB/Restore_the_GRUB_Bootloader#EFI_System

manjaro-chroot -a

Should do it also.

Yes, in another try following instructions found in a YouTube video I also did this, but nothing changed.
But following the tutorial I didn’t get the message “EFI variables are not supported on this system.” so I skipped that part.

By the way I tried following those instructions, and nothing. Running update-grub or grub-mkconfig shows the same output as before, so no OS in the list.

boot on USB iso manjaro

open a terminal and returns

inxi  -Mxa ( check for UEFI only , not UEFI[legacy] or Bios )
test -d /sys/firmware/efi && echo efi || echo bios
sudo parted -l
sudo efibootmgr -v

in your EFI

disable secure boot
disable fastboot
disks on AHCI
no legacy
no CSM
UEFI only or others ( not windows )

you should see
UEFI < USB vendor name > < patrition 1 > --> boot in EFI

Output:
Machine: Type: Laptop System: ASUSTeK product: UX310UQK v: 1.0 serial: <superuser/root required>
Mobo: ASUSTeK model: UX310UQK v: 1.0 serial: <superuser/root required>
UEFI: American Megatrends v: UX310UQK.311 date: 04/18/2019

Output:
efi

Output (sorry this output is in Italian):
Modello: ATA ST2000LM015-2E81 (scsi)
Disco /dev/sda: 2000GB
Dimensione del settore (logica/fisica): 512B/4096B
Tabella delle partizioni: msdos
Flag del disco:

Numero Inizio Fine Dimensione Tipo File system Flag
1 1049kB 2000GB 2000GB primary ntfs

Modello: ATA SanDisk SD8SN8U5 (scsi)
Disco /dev/sdb: 512GB
Dimensione del settore (logica/fisica): 512B/512B
Tabella delle partizioni: gpt
Flag del disco:

Numero Inizio Fine Dimensione File system Nome Flag
1 1049kB 106MB 105MB fat32 EFI system partition avvio, esp
2 106MB 240MB 134MB Microsoft reserved partition msftres
3 274MB 290MB 16,8MB Microsoft reserved partition msftres
4 290MB 381GB 381GB ntfs Basic data partition msftdata
5 381GB 382GB 579MB ntfs nascosta, diag
6 382GB 512GB 130GB ext4
7 512GB 512GB 523MB ntfs Basic data partition nascosta, diag

Modello: Verbatim (scsi)
Disco /dev/sdc: 15,9GB
Dimensione del settore (logica/fisica): 512B/512B
Tabella delle partizioni: msdos
Flag del disco:

Numero Inizio Fine Dimensione Tipo File system Flag
2 2134MB 2138MB 4194kB primary esp

Output:
BootCurrent: 0006
Timeout: 1 seconds
BootOrder: 0004,0001,0000,0002,0005,0006,0007
Boot0000* antergos_grub HD(1,GPT,aed21c68-78e2-4487-94ac-60cc3fafd534,0x800,0x32000)/File(\EFI\ANTERGOS_GRUB\GRUBX64.EFI)
Boot0001* manjaro HD(1,GPT,aed21c68-78e2-4487-94ac-60cc3fafd534,0x800,0x32000)/File(\EFI\MANJARO\GRUBX64.EFI)
Boot0002* ubuntu HD(1,GPT,aed21c68-78e2-4487-94ac-60cc3fafd534,0x800,0x32000)/File(\EFI\UBUNTU\SHIMX64.EFI)
Boot0004* Grub2Win EFI - 64 Bit HD(1,GPT,aed21c68-78e2-4487-94ac-60cc3fafd534,0x800,0x32000)/File(\EFI\GRUB2WIN\G2BOOTMGR\GNUGRUB.KERNEL64.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.}…h……
Boot0005* Windows Boot Manager HD(1,GPT,aed21c68-78e2-4487-94ac-60cc3fafd534,0x800,0x32000)/File(\EFI\MICROSOFT\BOOT\BOOTMGFW.EFI)…BO
Boot0006* UEFI: Verbatim PciRoot(0x0)/Pci(0x14,0x0)/USB(0,0)/CDROM(1,0x3f9b18,0x8000)…BO
Boot0007* UEFI: Verbatim, Partition 1 PciRoot(0x0)/Pci(0x14,0x0)/USB(0,0)/HD(1,MBR,0x0,0x3f9b18,0x2000)…BO

Here it shows also Antergos and Ubuntu because I installed them years ago before installing Manjaro and I think that there is a bit of files left.

In the EFI the settings are already like your, bot no solution.

Little update:
searching for solutions, I tought that installing an MBR manager on Windows would help.
I installed Grub2Win, and it found my Manjaro installation, but I need to run a script in Manjaro to let it boot.
I chrooted into Manjaro using a live USB in order to run that script, and it gave me this output:
"
Start SourceRun

End SourceRun

The kernset.sh script is being run with root privileges.
Running the - Linux - link setup using source directory /boot/.
The target directory is /boot/.
The modify date for /boot/initramfs-4.19-x86_64.img is Tue Dec 10 16:16:42 2019
The Linux kernel files were not found in the /boot directory
kernset.sh was aborted
"

As you can see, an error of the script is “Linux kernel files were not found in /boot”. I run an ls -l/mnt/boot where I mounted the system, and this is the output:
"
drwxr-xr-x 4 root root 1024 1 gen 1970 efi
drwxr-xr-x 6 root root 4096 29 nov 14.47 grub
-rw-r–r-- 1 root root 29947318 10 dic 2019 initramfs-4.19-x86_64-fallback.img
-rw-r–r-- 1 root root 8690952 10 dic 2019 initramfs-4.19-x86_64.img
-rw-r–r-- 1 root root 3621888 19 nov 07.58 intel-ucode.img
-rw-r–r-- 1 root root 23 24 nov 18.41 linux419-x86_64.kver
-rw-r–r-- 1 root root 21 28 nov 09.57 linux54-x86_64.kver
drwxr-xr-x 2 root root 4096 28 nov 17.59 memtest86+
"

and there is no vmlinuz file. But running mhwd-kernel -li it gives me this output:
"
Currently running: 5.8.16-2-MANJARO (linux58)
The following kernels are installed in your system:
* linux419
* linux54
"

So there should be the kernel.
This could help somehow?

EDIT:
Yes, trying installing the kernel 5.8 with mhwd-kernel -i linux58 it gives me in output:
Error: You can’t reinstall your current kernel. Please use ‘pacman -Syu’ instead to update.

So the kernel is somehow installed

you boot on USB iso manjaro
open a terminal and returns output results

sudo lsblk -fs ( check UIId /boot/efi sdb1 )
sudo manjaro-chroot -a
cat /etc/fstab ( check that /boot/efi has same UUID )
mkinitcpio -P 
exit 

NAME FSTYPE FSVER LABEL UUID FSAVAIL FSUSE% MOUNTPOINT
loop0 squashfs 4.0 0 100% /run/miso/sfs/livefs
loop1 squashfs 4.0 0 100% /run/miso/sfs/mhwdfs
loop2 squashfs 4.0 0 100% /run/miso/sfs/desktopfs
loop3 squashfs 4.0 0 100% /run/miso/sfs/rootfs
sda1 ntfs HDD_2TB 268E2B218E2AE94F
└─sda
sdb1 vfat FAT32 SISTEMA 6042-4026
└─sdb
sdb2
└─sdb
sdb3
└─sdb
sdb4 ntfs OS 383C18513C180C8E
└─sdb
sdb5 ntfs 52D0B756D0B73F53
└─sdb
sdb6 ext4 1.0 ec0ce088-454a-4337-a0b6-a5e9a8153ce5
└─sdb
sdb7 ntfs RECOVERY 00E07C63E07C6138
└─sdb
sdc1 iso9660 Joliet Extension MANJARO_I3_2012 2020-10-19-18-53-23-00
└─sdc iso9660 Joliet Extension MANJARO_I3_2012 2020-10-19-18-53-23-00 0 100% /run/miso/bootmnt
sdc2 vfat FAT12 MISO_EFI CBF3-152A
└─sdc iso9660 Joliet Extension MANJARO_I3_2012 2020-10-19-18-53-23-00 0 100% /run/miso/bootmnt

So the UUID is 6042-4026

UUID=6042-4026 /boot/efi vfat defaults,noatime 0 2
UUID=ec0ce088-454a-4337-a0b6-a5e9a8153ce5 / ext4 defaults,noatime,discard 0 1
tmpfs /tmp tmpfs defaults,noatime,mode=1777 0 0

The UUID is the same.

==> ERROR: No presets found in /etc/mkinitcpio.d

then you have to add this file preset

# mkinitcpio preset file for the 'linux54' package

ALL_config="/etc/mkinitcpio.conf"
ALL_kver="/boot/vmlinuz-5.4-x86_64"

PRESETS=('default' 'fallback')

#default_config="/etc/mkinitcpio.conf"
default_image="/boot/initramfs-5.4-x86_64.img"
#default_options=""

# mkinitcpio preset file for the 'linux54' package

ALL_config="/etc/mkinitcpio.conf"
ALL_kver="/boot/vmlinuz-5.4-x86_64"

PRESETS=('default' 'fallback')

#default_config="/etc/mkinitcpio.conf"
default_image="/boot/initramfs-5.4-x86_64.img"
#default_options=""

#fallback_config="/etc/mkinitcpio.conf"
fallback_image="/boot/initramfs-5.4-x86_64-fallback.img"
fallback_options="-S autodetect"

with

sudo manjaro-chroot -a
nano /etc/mkinitcpio.d/linux54.preset 
mkinitcpio -P
exit 

[UPDATE]
I found a thread here wrote about 20 days ago of someone who had my same problem and no ‘vmlinuz’ file under the /boot directory. Someone made him install the linux54 and linux419 and he said that after that the system works.
I tried following that instructions, and now Manjaro is in the GRUB OS list and it starts, but then I think it bootloops because after the ASUS logo, I can see the cursor for about half a second and then again the ASUS logo, and this is in loop.

After installing the kernels like I said in my last update, I saw that now the file linux54.preset was already there. So I tried running again

And this is the output:
==> Building image from preset: /etc/mkinitcpio.d/linux419.preset: ‘default’
→ -k /boot/vmlinuz-4.19-x86_64 -c /etc/mkinitcpio.conf -g /boot/initramfs-4.19-x86_64.img
==> Starting build: 4.19.160-1-MANJARO
→ Running build hook: [base]
→ Running build hook: [udev]
→ Running build hook: [autodetect]
→ Running build hook: [modconf]
→ Running build hook: [block]
→ Running build hook: [keyboard]
→ Running build hook: [keymap]
→ Running build hook: [filesystems]
==> Generating module dependencies
==> Creating gzip-compressed initcpio image: /boot/initramfs-4.19-x86_64.img
==> Image generation successful
==> Building image from preset: /etc/mkinitcpio.d/linux419.preset: ‘fallback’
→ -k /boot/vmlinuz-4.19-x86_64 -c /etc/mkinitcpio.conf -g /boot/initramfs-4.19-x86_64-fallback.img -S autodetect
==> Starting build: 4.19.160-1-MANJARO
→ Running build hook: [base]
→ Running build hook: [udev]
→ Running build hook: [modconf]
→ Running build hook: [block]
→ Running build hook: [keyboard]
→ Running build hook: [keymap]
→ Running build hook: [filesystems]
==> Generating module dependencies
==> Creating gzip-compressed initcpio image: /boot/initramfs-4.19-x86_64-fallback.img
==> Image generation successful
==> Building image from preset: /etc/mkinitcpio.d/linux54.preset: ‘default’
→ -k /boot/vmlinuz-5.4-x86_64 -c /etc/mkinitcpio.conf -g /boot/initramfs-5.4-x86_64.img
==> Starting build: 5.4.80-2-MANJARO
→ Running build hook: [base]
→ Running build hook: [udev]
→ Running build hook: [autodetect]
→ Running build hook: [modconf]
→ Running build hook: [block]
→ Running build hook: [keyboard]
→ Running build hook: [keymap]
→ Running build hook: [filesystems]
==> Generating module dependencies
==> Creating gzip-compressed initcpio image: /boot/initramfs-5.4-x86_64.img
==> Image generation successful
==> Building image from preset: /etc/mkinitcpio.d/linux54.preset: ‘fallback’
→ -k /boot/vmlinuz-5.4-x86_64 -c /etc/mkinitcpio.conf -g /boot/initramfs-5.4-x86_64-fallback.img -S autodetect
==> Starting build: 5.4.80-2-MANJARO
→ Running build hook: [base]
→ Running build hook: [udev]
→ Running build hook: [modconf]
→ Running build hook: [block]
→ Running build hook: [keyboard]
→ Running build hook: [keymap]
→ Running build hook: [filesystems]
==> Generating module dependencies
==> Creating gzip-compressed initcpio image: /boot/initramfs-5.4-x86_64-fallback.img
==> Image generation successful

So now it did something.

then

sudo manjaro-chroot -a 
update-grub
exit

Manjaro now it’s in the GRUB list like after I installed the kernel, but it is still in bootloop.

recheck all option in UEFI motherboard

Yes, everything is still like you wrote before.
Secure boot disabled, Fast boot disabled, CSM Support disabled, SATA Mode Selection on AHCI. I can’t find the other 2 options you wrote.

Since I solved the problem of GRUB not finding Manjaro I’ll flag this thread as [SOLVED].
The solution was that after I updated the system, somehow the kernel files were gone. So the solution was to reinstall them again and now GRUB shows Manjaro in the OS list.
I have now problems starting the system, but I’ll open a new thread for this.
Thanks to everyone who helped.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.