Grub-mkconfig finds no OS in manjaro-chroot

I was trying to restore GRUB according to instructions here. Before doing the chroot, I can see windows and manjaro:

[manjaro@manjaro ~]$ sudo os-prober
/dev/sda2@/efi/Microsoft/Boot/bootmgfw.efi:Windows Boot Manager:Windows:efi
/dev/sda7:Manjaro Linux (21.1.0):ManjaroLinux:linux
grub-probe: error: cannot find a GRUB drive for /dev/sdb1.  Check your device.map.
grub-probe: error: cannot find a GRUB drive for /dev/sdb1.  Check your device.map.

After using manjaro-chroot -a, I get this result:

[manjaro /]# sudo os-prober
grub-probe: error: cannot find a GRUB drive for /dev/sdb1.  Check your device.map.
grub-probe: error: cannot find a GRUB drive for /dev/sdb1.  Check your device.map.

The partitions can be seen by chroot.

sudo fdisk -l
Disk /dev/sda: 223.57 GiB, 240057409536 bytes, 468862128 sectors
Disk model: ADATA SU635     
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: 87229DE5-2126-46D1-A7AB-033F20B18790

Device         Start       End   Sectors   Size Type
/dev/sda1       2048   1085439   1083392   529M Windows recovery environment
/dev/sda2    1085440   1288191    202752    99M EFI System
/dev/sda3    1288192   1320959     32768    16M Microsoft reserved
/dev/sda4    1320960 225279999 223959040 106.8G Microsoft basic data
/dev/sda5  225280000 226328575   1048576   512M Microsoft basic data
/dev/sda6  226328576 230522879   4194304     2G Linux swap
/dev/sda7  230522880 468862094 238339215 113.6G Linux filesystem

[manjaro /]# ls /boot/
amd-ucode.img  efi  grub  linux510-x86_64.kver.old  memtest86+

[manjaro /]# ls /sys/firmware/efi/
config_table  fw_platform_size  runtime      systab
efivars       fw_vendor         runtime-map

[manjaro /]# efibootmgr
BootCurrent: 0006
Timeout: 1 seconds
BootOrder: 0001,0006,0004,0000,0005
Boot0000* Windows Boot Manager
Boot0001* manjaro
Boot0004* ubuntu
Boot0005* UEFI OS
Boot0006* UEFI OS

This seems odd though:

[manjaro /]# lsblk -o PATH,PTTYPE,PARTTYPE,FSTYPE,PARTTYPENAME
PATH       PTTYPE PARTTYPE FSTYPE PARTTYPENAME
/dev/loop0                        
/dev/loop1                        
/dev/loop2                        
/dev/loop3                        
/dev/sda                          
/dev/sda1                         
/dev/sda2                         
/dev/sda3                         
/dev/sda4                         
/dev/sda5                         
/dev/sda6                         
/dev/sda7                         
/dev/sdb                          
/dev/sdb1                         
/dev/sdb2                         
/dev/sr0

Can you update the above with the output of sudo efibootmgr -v

Out of curiosity: Are you multi-booting Windows/Manjaro/Ubuntu ? are you able to boot Manjaro/other OSs from UEFI boot menu?

How long did you wait? os-prober could take several minutes before providing the result.

Your ESP is pretty small, when you installed a lot of other OS upfront maybe too small to restore grub properly.

os-prober doesn’t find the current OS. That’s the expected behavior. So it’s not going to find your Manjaro installation from inside your Manjaro system.

About Windows, I have noticed that in some cases it does not find it either in chroot. I’m not sure why. But if you recover grub, boot your Manjaro and run sudo update-grub (with os-prober activated), it’s going to find it.

Multi-booting Windows and Manjaro only. I’m not sure where the ubuntu came from, I might have tried linux mint on this machine a long long time ago. I never got around to cleaning it up. I am not able to boot anything now, after chroot installing and configuring GRUB, I get a rescue terminal.

[manjaro /]# sudo efibootmgr -v
BootCurrent: 0006
Timeout: 1 seconds
BootOrder: 0006,0004,0000,0005,0001
Boot0000* Windows Boot Manager	HD(2,GPT,70bdabc4-a8b4-45f9-8a0a-ca255003addf,0x109000,0x31800)/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.}...a................
Boot0001* manjaro	HD(5,GPT,9b820989-415e-3648-b3e9-d47d2da2266c,0xd6d8000,0x100000)/File(\EFI\MANJARO\GRUBX64.EFI)
Boot0004* ubuntu	HD(2,GPT,70bdabc4-a8b4-45f9-8a0a-ca255003addf,0x109000,0x31800)/File(\EFI\UBUNTU\SHIMX64.EFI)..BO
Boot0005* UEFI OS	HD(5,GPT,9b820989-415e-3648-b3e9-d47d2da2266c,0xd6d8000,0x100000)/File(\EFI\BOOT\BOOTX64.EFI)..BO
Boot0006* UEFI OS	HD(2,MBR,0xc18c41f6,0x3dac40,0x2000)/File(\EFI\BOOT\BOOTX64.EFI)..BO

Is that odd that MBR is first in BootOrder? Think a GPT should be first for GRUB/linux.

I waited until I got the terminal prompt back. os-prober was a roundabout way of saying my grub config isn’t working. See below:

[manjaro /]# sudo grub-mkconfig -o /boot/grub/grub.cfg
Generating grub configuration file ...
Found theme: /usr/share/grub/themes/manjaro/theme.txt
Warning: os-prober will be executed to detect other bootable partitions.
Its output will be used to detect bootable binaries on them and create new boot entries.
grub-probe: error: cannot find a GRUB drive for /dev/sdb1.  Check your device.map.
grub-probe: error: cannot find a GRUB drive for /dev/sdb1.  Check your device.map.
Adding boot menu entry for UEFI Firmware Settings ...
Found memtest86+ image: /boot/memtest86+/memtest.bin
done
[manjaro /]# cat /boot/grub/grub.cfg 
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
insmod part_gpt
insmod part_msdos
if [ -s $prefix/grubenv ]; then
  load_env
fi
if [ "${next_entry}" ] ; then
   set default="${next_entry}"
   set next_entry=
   save_env next_entry
   set boot_once=true
else
   set default="${saved_entry}"
fi

if [ x"${feature_menuentry_id}" = xy ]; then
  menuentry_id_option="--id"
else
  menuentry_id_option=""
fi

export menuentry_id_option

if [ "${prev_saved_entry}" ]; then
  set saved_entry="${prev_saved_entry}"
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi

function savedefault {
  if [ -z "${boot_once}" ]; then
    saved_entry="${chosen}"
    save_env saved_entry
  fi
}

function load_video {
  if [ x$feature_all_video_module = xy ]; then
    insmod all_video
  else
    insmod efi_gop
    insmod efi_uga
    insmod ieee1275_fb
    insmod vbe
    insmod vga
    insmod video_bochs
    insmod video_cirrus
  fi
}

set menu_color_normal=light-gray/black
set menu_color_highlight=green/black

if [ x$feature_default_font_path = xy ] ; then
   font=unicode
else
insmod part_gpt
insmod ext2
set root='hd0,gpt7'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt7 --hint-efi=hd0,gpt7 --hint-baremetal=ahci0,gpt7  ba2fa3f3-e69d-45f0-a111-7f2e3df65f3f
else
  search --no-floppy --fs-uuid --set=root ba2fa3f3-e69d-45f0-a111-7f2e3df65f3f
fi
    font="/usr/share/grub/unicode.pf2"
fi

if loadfont $font ; then
  set gfxmode=auto
  load_video
  insmod gfxterm
fi
terminal_input console
terminal_output gfxterm
insmod part_gpt
insmod ext2
set root='hd0,gpt7'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt7 --hint-efi=hd0,gpt7 --hint-baremetal=ahci0,gpt7  ba2fa3f3-e69d-45f0-a111-7f2e3df65f3f
else
  search --no-floppy --fs-uuid --set=root ba2fa3f3-e69d-45f0-a111-7f2e3df65f3f
fi
insmod gfxmenu
loadfont ($root)/usr/share/grub/themes/manjaro/dejavu_sans_12.pf2
loadfont ($root)/usr/share/grub/themes/manjaro/dejavu_sans_14.pf2
loadfont ($root)/usr/share/grub/themes/manjaro/dejavu_sans_16.pf2
loadfont ($root)/usr/share/grub/themes/manjaro/dejavu_sans_24.pf2
loadfont ($root)/usr/share/grub/themes/manjaro/dejavu_sans_48.pf2
loadfont ($root)/usr/share/grub/themes/manjaro/dejavu_sans_bold_16.pf2
loadfont ($root)/usr/share/grub/themes/manjaro/dejavu_sans_mono_12.pf2
loadfont ($root)/usr/share/grub/themes/manjaro/terminus-12.pf2
loadfont ($root)/usr/share/grub/themes/manjaro/terminus-14.pf2
loadfont ($root)/usr/share/grub/themes/manjaro/terminus-16.pf2
loadfont ($root)/usr/share/grub/themes/manjaro/terminus-18.pf2
loadfont ($root)/usr/share/grub/themes/manjaro/terminus-b12.pf2
loadfont ($root)/usr/share/grub/themes/manjaro/terminus-b14.pf2
loadfont ($root)/usr/share/grub/themes/manjaro/terminus-b16.pf2
loadfont ($root)/usr/share/grub/themes/manjaro/terminus-b18.pf2
insmod png
set theme=($root)/usr/share/grub/themes/manjaro/theme.txt
export theme
if [ x$feature_timeout_style = xy ] ; then
  set timeout_style=hidden
  set timeout=10
# Fallback hidden-timeout code in case the timeout_style feature is
# unavailable.
elif sleep --interruptible 10 ; then
  set timeout=0
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/10_linux ###

### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/30_uefi-firmware ###
menuentry 'UEFI Firmware Settings' $menuentry_id_option 'uefi-firmware' {
	fwsetup
}
### END /etc/grub.d/30_uefi-firmware ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f  ${config_directory}/custom.cfg ]; then
  source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg
fi
### END /etc/grub.d/41_custom ###

### BEGIN /etc/grub.d/60_memtest86+ ###
if [ "${grub_platform}" == "pc" ]; then
    menuentry "Memory Tester (memtest86+)" --class memtest86 --class gnu --class tool {
        search --fs-uuid --no-floppy --set=root --hint-bios=hd0,gpt7 --hint-efi=hd0,gpt7 --hint-baremetal=ahci0,gpt7  ba2fa3f3-e69d-45f0-a111-7f2e3df65f3f
        linux16 /boot/memtest86+/memtest.bin 
    }
fi
### END /etc/grub.d/60_memtest86+ ###

How can I get rid of the ubuntu entry that I’m not using to free up some space on my efi partition?

You are fine if you don’t install a bunch of different Windows installations. Linux boot takes only some kilobytes:
kuva

You can remove entries (for example ubuntu, entry number 4) from UEFI with:

efibootmgr -b 4 -B

Do you have any kernel installed? If update-grub doesn’t find your Manjaro, it can mean that you don’t have any kernels to find or that the script in /etc/grub.d/ is not active (maybe you have edited something there or you have used grub-customizer at some point).

Does the “.old” extension (see below) mean I have no kernels installed? mhwd-kernel -i linux510-rt (apparently my VM software needs an RT kernel) did not look like it worked in chroot.

[manjaro /]# ls /boot/
amd-ucode.img  efi  grub  linux510-x86_64.kver.old  memtest86+

Yes, You don’t have any kernels. The .kver file is not even a kernel image.

It should work as far as I know. You can try to install manually in any case:

pamac install linux510-rt

awesome, that appears to have worked. At least now i have a kernel in /boot.

Ran sudo update-grub and I have my dual boot back. Just need to delete the nonworking boot entries (UEFI OS and ubuntu).

I wrote the instructions in a previous post. I think you don’t need to remove UEFI OS entries as I think they are system entries.

Thanks, I deleted ubuntu, efibootmgr showed ubuntu deleted, rebooted, efibootmgr showed ubuntu back but one of the UEFI OS entries missing, deleted ubuntu again, rebooted again and now just have manjaro, windows, and UEFI. I assume it kept the important UEFI entry and the other was attached to ubuntu.

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