Unable to boot into Manjaro or reinstall Grub after UEFI update in dual-boot setup with Windows

Hmm, unfortunately grub-mkdevicemap is returning as

bash: grub-mkdevicemap: command not found

I can’t find that package on pacman either or AUR. Is there an equivalent command that I can use for Manjaro or find that package somewhere else?

Ah, that makes sense, I had been using /dev/nvme0n1p.

Now I executed with /dev/nvme0n1.

No luck :frowning:

I wonder what’s going on with the /dev/nvme0n1p1, it’s like no changes are persisting.

so few more things, apparently why grub-install works on some systems but not on others to install both grub and EFI entry is because the live-media is not in EFI mode. you cant test which mode your live-media is on by

test -d /sys/firmware/efi && echo efi || echo bios

i use ventoy created in EFI mode (create with -g switch). this is not mandatory but will make things easier as i have found.

you are here now;
https://wiki.archlinux.org/title/GRUB#Drop_to_rescue_shell

check whehter you got /boot/grub/grub.cfg
if not;

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

and also for nvme drives you can directly use “efibootmgr --create --disk /dev/nvme0n1p1 …”

[root@manjaro-gnome efi]# test -d /sys/firmware/efi && echo efi || echo bios
efi

Also /boot/grub/grub.cfg is present from chroot.

One thing to note, after I ran the commands we discussed above, efibootmgr -v does show Manjaro, but if I navigate to /boot/efi/EFI, I do not see a manjaro entry. This is even after the update-grub is run. Is that an expectation?

(thanks for all the help by the way! I really appreciate it, this issue is just totally confounding me)

run “grub-mkconfig -o /boot/grub/grub.cfg” anyway

from the little i know its grub-install (or efibootmgr --create), that puts “grubx64.efi” under “/boot/efi/EFI/manjaro/”.

Try with the ‘sudo’:

sudo grub-mkdevicemap
sudo update-grub
reboot

Also, have you checked that your efi partition’s UUID matches the one in your fstab? List the UUID:
ls -l /dev/disk/by-uuid
and check against your fstab:
cat /etc/fstab

It’s the same with sudo grub-mkdevicemap, I get sudo: grub-mkdevicemap: command not found.

I was running priorly on su with same results.

Could you share the location of grub-mkdevicemap on your system with something like a which so I can visit the same location?

That didn’t help either.

Here is where I think the problem become visible early, neither the efibootmgr --create --disk /dev/nvme0n1 --part 1 --loader "\EFI\manjaro\grubx64.efi" --label "manjaro" --verbose [1] nor the grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=manjaro --recheck --no-rs-codes --verbose [2] commands seem to add an entry in /boot/efi/EFI.

Here’s how I know:

  1. manjaro-chroot -a
[root@manjaro-gnome /]# cat /etc/fstab 
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a device; this may
# be used with UUID= as a more robust way to name devices that works even if
# disks are added and removed. See fstab(5).
#
# <file system>             <mount point>  <type>  <options>  <dump>  <pass>
UUID=3E2D-C09A                            /boot/efi      vfat    umask=0077 0 2
UUID=69d80b23-c4e3-49a1-9ec9-a45ea00bfead /              ext4    defaults,noatime 0 1
UUID=d7e8de54-a2a1-4e4c-8103-71695a986efb /home          ext4    defaults,noatime 0 2

Note that the UUID of the /boot/efi partition is 3E2D-C09A
3.

[root@manjaro-gnome /]# blkid
/dev/loop1: TYPE="squashfs"
/dev/nvme0n1p7: UUID="fec75e21-7303-4a72-a5e7-2c94a9c93dca" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="eac06ff1-8567-cf4d-be64-45e7e76c29a0"
/dev/nvme0n1p5: UUID="69d80b23-c4e3-49a1-9ec9-a45ea00bfead" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="9d1eadf7-ccce-0a43-bfad-4a74bd4daa21"
/dev/nvme0n1p3: LABEL="Windows" BLOCK_SIZE="512" UUID="902C2E712C2E5290" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="867fd4ba-bd06-478c-a55b-3254a901f683"
/dev/nvme0n1p1: LABEL_FATBOOT="SYSTEM" LABEL="SYSTEM" UUID="3E2D-C09A" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="EFI System Partition" PARTUUID="187cd5f4-1d56-4e19-bb9f-63b345ddf421"
/dev/nvme0n1p6: UUID="d7e8de54-a2a1-4e4c-8103-71695a986efb" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="0f3d8dc4-1dc9-d046-bcf5-a9427a904b62"
/dev/nvme0n1p4: LABEL="WinRE" BLOCK_SIZE="512" UUID="64E82EF2E82EC1E2" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="fc57d984-6919-4cf3-bb9c-e1ced50bcb41"
/dev/nvme0n1p2: PARTLABEL="Microsoft reserved partition" PARTUUID="bd1d6f4d-6d2e-4a95-b967-0ed8fbcaa077"
/dev/loop2: TYPE="squashfs"
/dev/loop0: TYPE="squashfs"
/dev/sda2: SEC_TYPE="msdos" LABEL_FATBOOT="MISO_EFI" LABEL="MISO_EFI" UUID="A70B-30CF" BLOCK_SIZE="512" TYPE="vfat"
/dev/sda1: BLOCK_SIZE="2048" UUID="2021-10-17-17-43-04-00" LABEL="MANJARO_GNOME_2116" TYPE="iso9660"
/dev/loop3: TYPE="squashfs"

Note that /dev/nvme0n1p1 is indeed 3E2D-C09A

Now after executing either commands 1 or 2 followed by a ‘grub-update’ and ‘grub-mkconfig’, I should be seeing manjaro under /boot/efi/EFI, but that’s not the case as demonstrated below

[root@manjaro-gnome /]# efibootmgr -v
BootCurrent: 0003
Timeout: 0 seconds
BootOrder: 0005,0004,2001,0001,0000,0002,2002,2003
Boot0000* Windows Boot Manager	HD(1,GPT,187cd5f4-1d56-4e19-bb9f-63b345ddf421,0x800,0x32000)/File(\EFI\Microsoft\Boot\bootmgfw.efi)RC
Boot0001* ubuntu	HD(1,GPT,187cd5f4-1d56-4e19-bb9f-63b345ddf421,0x800,0x32000)/File(\EFI\ubuntu\shimx64.efi)RC
Boot0002* Fedora	HD(1,GPT,187cd5f4-1d56-4e19-bb9f-63b345ddf421,0x800,0x32000)/File(\EFI\fedora\shim.efi)RC
Boot0003* EFI USB Device (SanDisk Cruzer Glide)	PciRoot(0x0)/Pci(0x14,0x0)/USB(1,0)/HD(1,MBR,0x0,0x5d5a40,0x2000)RC
Boot0004* manjaro	HD(1,GPT,187cd5f4-1d56-4e19-bb9f-63b345ddf421,0x800,0x32000)/File(\EFI\manjaro\grubx64.efi)
Boot0005* manjaro	HD(1,GPT,187cd5f4-1d56-4e19-bb9f-63b345ddf421,0x800,0x32000)/File(\EFI\manjaro\grubx64.efi)
Boot2001* EFI USB Device	RC
Boot2002* EFI DVD/CDROM	RC
Boot2003* EFI Network	RC
[root@manjaro-gnome /]# ls /boot/efi/EFI/
Boot  HUAWEI  Microsoft  UpdateCapsule	fedora	ubuntu

I feel that after running step 4, step 5 should have a different output and that’s the crux of the problem. Thoughts?

fstab looks good to me.

this has something to with the issue, but the fact that you reach grub rescue shell means something is(maybe) working. you have to make sure the grub you drop into is from the manjaro and not from previous linux installations. i’m not at all familiar with grub prompt but try and see which partition it refers to in that shell.

other than check “/boot/grub/” contents in manjaro-chroot environment. mine looks like ;

ll /boot/grub/
total 56K
drwxr-xr-x 6 root root 4.0K Dec 16 08:41 ./
drwxr-xr-x 5 root root 4.0K Dec 16 08:41 ../
drwxr-xr-x 2 root root 4.0K Apr 27  2020 fonts/
-rw-r--r-- 1 root root  11K Dec 16 08:41 grub.cfg
-rw-r--r-- 1 root root 1.0K Apr 27  2020 grubenv
drwxr-xr-x 2 root root 4.0K Nov 22 05:30 locale/
drwxr-xr-x 3 root root 4.0K Apr 27  2020 themes/
drwxr-xr-x 2 root root  20K Nov 22 05:30 x86_64-efi/

you might not have all contents, but as per archwiki the reason why you drop into grub rescue shell is because of absence of grub.cfg

OH MY GOD, it worked!

I installed refind, and it is able to find the last Manjaro install that I did (which oddly enough was a crap install that I did :slight_smile: )

Here is where I found the link

Specifically, the section after this line

“Some manufactures EFI implementations cause GRUB not to be showed in the Boot Menu, or even if its there it can’t be made default.”

So it looks like the BIOS update that I did didn’t like Grub. What made matter more complex was:

  1. My preexisting grub install from Ubuntu and/or Fedora which were the grub shell that I would be dropped to
  2. I still have no idea where Manjaro is booting from. This is still the contents of /boot/efi
[root@kh-machwx9 EFI]# ls
Boot  fedora  HUAWEI  Microsoft  ubuntu  UpdateCapsule

I would have expected to see Manjaro listed there, any idea where it’s coming from?

Here are the contents of /boot/grub

[root@kh-machwx9 boot]# ls -hal /boot/grub/
total 20K
drwxr-xr-x 2 root root 4.0K Dec 16 12:55 .
drwxr-xr-x 5 root root 4.0K Dec 13 08:23 ..
-rw-r--r-- 1 root root 6.2K Dec 16 12:55 grub.cfg
-rw-r--r-- 1 root root 1.0K Oct 17 10:02 grubenv

In either case, I have enough to restart with a fresh install and still have my home dir and now have a snazzy boot loader. Thank you for ALL the help, I learned a lot from this experience.