Can't boot into Manjaro after switching to UEFI

Hi guys,

so this is quite a long story, but I will try and keep it short.
Firstly I have a dual boot setup with Windows on one drive and Manjaro on another drive. I was using grub as boot manager and to switch between the systems

  1. My Windows installation was essentially broken, so I did a fresh install. Everything went well, I was able to start Windows.
  2. Installing Windows ofc breaks grub, so I reinstalled grub following the usual guide. Again everything went well, but after restarting and selecting Windows in grub, I got a BSOD. After a bit of reseach I found out that I somehow installed Windows in UEFI mode, but that Manjaro was installed in Legacy mode.
  3. I tried to reinstall Windows in Legacy mode, but failed due to some issue I couldn’t solve. So instead I decided to switch Manjaro from Legacy to UEFI following this guide. Ofc I had to change the partition table of the drive Manjaro was installed on, but that didn’t cause any trouble.
    Now after installing grub, there should have been the option to select it in the BIOS, but that was not the case.
    So I installed refind (see this issue) and I am able to select refind in my BIOS, but it seems like refind is not able to detect Manjaro. I can boot into Windows using refind just fine.

I hope guys can help me with this. If you need the output of a tool, please let me know.

Thanks

is your bios in uefi mode?

Yes, it is currently in UEFI mode.

but it was in legacy mode before you messed up things?
boot into manjaro live iso and provide:
lsblk -f
sudo parted -l
test -d /sys/firmware/efi && echo efi || echo bios

Indeed, it was in UEFI+Legacy mode, but that doesn’t make a difference right now.

lsblk -f

NAME       FSTYPE   FSVER            LABEL            UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
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
sda                                                                                                       
├─sda1     vfat     FAT32                             4C3C-6793                                           
├─sda2                                                                                                    
├─sda3     ntfs                                       18D45014D44FF314                                    
└─sda4     ntfs                                       721437E81437AE4B                                    
sdb                                                                                                       
├─sdb1     ntfs                      Hauptplatte      01D3C542C44B29D0                                    
├─sdb2     ext4     1.0                               e4819263-1437-47cb-8afa-8e9230eb7a8d                
└─sdb3     swap     1                                 6697a587-6eda-4f18-88a9-1ba83fc20b33                
sdc                                                                                                       
├─sdc1     vfat     FAT32                             3A10-AD17                                           
├─sdc2     ext4     1.0                               911149de-2563-4198-89df-8d3832fd2b05                
└─sdc3     ext4     1.0                               63b20c95-fc92-475f-b8b6-18fa6880d5c8                
sdd                                                                                                       
└─sdd1     ntfs                                       0E8A16C30E8A16C3                                    
sde                                                                                                       
├─sde1     exfat    1.0              Ventoy           F508-B40B                                           
│ └─ventoy iso9660  Joliet Extension MANJARO_KDE_2135 2022-07-21-09-20-14-00                     0   100% /run/miso/bootmnt
└─sde2     vfat     FAT16            VTOYEFI          66F6-D57E

sudo parted -l

Model: ATA KINGSTON SV300S3 (scsi)
Disk /dev/sda: 120GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End    Size    File system  Name                          Flags
 1      1049kB  106MB  105MB   fat32        EFI system partition          boot, esp
 2      106MB   123MB  16.8MB               Microsoft reserved partition  msftres
 3      123MB   119GB  119GB   ntfs         Basic data partition          msftdata
 4      119GB   120GB  542MB   ntfs                                       hidden, diag


Model: ATA ST1000DM003-1CH1 (scsi)
Disk /dev/sdb: 1000GB
Sector size (logical/physical): 512B/4096B
Partition Table: msdos
Disk Flags: 

Number  Start   End    Size    Type     File system     Flags
 1      1049kB  482GB  482GB   primary  ntfs
 2      482GB   696GB  213GB   primary  ext4
 3      696GB   714GB  18.9GB  primary  linux-swap(v1)  swap


Model: ATA SanDisk SDSSDA24 (scsi)
Disk /dev/sdc: 240GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End    Size   File system  Name  Flags
 1      1049kB  316MB  315MB  fat32              boot, legacy_boot, esp
 2      316MB   119GB  119GB  ext4
 3      119GB   229GB  110GB  ext4


Model: ATA CT500MX500SSD1 (scsi)
Disk /dev/sdd: 500GB
Sector size (logical/physical): 512B/4096B
Partition Table: msdos
Disk Flags: 

Number  Start   End    Size   Type     File system  Flags
 1      1049kB  488GB  488GB  primary  ntfs


Model: JetFlash Transcend 32GB (scsi)
Disk /dev/sde: 31.6GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start   End     Size    Type     File system  Flags
 1      1049kB  31.6GB  31.6GB  primary               boot
 2      31.6GB  31.6GB  33.6MB  primary  fat16        esp

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

Edit: sidenote: the first drive sda is the Windows drive and the third drive sdc is my Manjaro drive

so chroot into manjaro and reinstall grub:

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

if there are any errors post them here

i would look at installed bootloaders before i install any

run;

efibootmgr

post the output

Generated this error:

Generating grub configuration file ...
Found theme: /usr/share/grub/themes/manjaro/theme.txt
Found linux image: /boot/vmlinuz-5.15-x86_64
Found initrd image: /boot/intel-ucode.img /boot/initramfs-5.15-x86_64.img
Found initrd fallback image: /boot/initramfs-5.15-x86_64-fallback.img
Found linux image: /boot/vmlinuz-5.10-x86_64
Found initrd image: /boot/intel-ucode.img /boot/initramfs-5.10-x86_64.img
Found initrd fallback image: /boot/initramfs-5.10-x86_64-fallback.img
Found linux image: /boot/vmlinuz-5.4-x86_64
Found initrd image: /boot/intel-ucode.img /boot/initramfs-5.4-x86_64.img
Found initrd fallback image: /boot/initramfs-5.4-x86_64-fallback.img
Found linux image: /boot/vmlinuz-5.15-x86_64
Found initrd image: /boot/intel-ucode.img /boot/initramfs-5.15-x86_64.img
Found initrd fallback image: /boot/initramfs-5.15-x86_64-fallback.img
Found linux image: /boot/vmlinuz-5.10-x86_64
Found initrd image: /boot/intel-ucode.img /boot/initramfs-5.10-x86_64.img
Found initrd fallback image: /boot/initramfs-5.10-x86_64-fallback.img
Found linux image: /boot/vmlinuz-5.4-x86_64
Found initrd image: /boot/intel-ucode.img /boot/initramfs-5.4-x86_64.img
Found initrd fallback image: /boot/initramfs-5.4-x86_64-fallback.img
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.
ERROR: mkdir /var/lock/dmraid
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.
Adding boot menu entry for UEFI Firmware Settings ...
Adding boot menu entry for UEFI Firmware Settings ...
Found memtest86+ image: /boot/memtest86+/memtest.bin
done

efibootmgr

BootCurrent: 0002
Timeout: 1 seconds
BootOrder: 0004,0002,0000,000D,000B,0003,0006,0001,0007
Boot0000* Windows Boot Manager  HD(1,GPT,369bdc03-e19a-4890-8630-e7a6a68e696e,0x800,0x32000)/File(\EFI\MICROSOFT\BOOT\BOOTMGFW.EFI)57494e444f5753000100000088000000780000004200430044004f0042004a004500430054003d007b00390064006500610038003600320063002d0035006300640064002d0034006500370030002d0061006300630031002d006600330032006200330034003400640034003700390035007d0000002c000100000010000000040000007fff0400
Boot0001  Hard Drive    BBS(HD,,0x0)0000474f00004e4fa7000000090000006f00530061006e004400690073006b002000530044005300530044004100320034003000470000000501090002000000007fff040002010c00d041030a0000000001010600021f03120a000300ffff00007fff040001043e00ef47642dc93ba041ac194d51d01b4ce63600310037003400370035003400340034003400300031002000200020002000200020002000200000007fff04000000424f00004e4fa7000000090000006f0053005400310030003000300044004d003000300033002d0031004300480031003600320000000501090002000000007fff040002010c00d041030a0000000001010600021f03120a000100ffff00007fff040001043e00ef47642dc93ba041ac194d51d01b4ce620002000200020002000200020002000200020002000200031005700330044004200360045004a0000007fff04000000424f00004e4faf000000090000006f004b0049004e004700530054004f004e002000530056003300300030005300330037004100310032003000470000000501090002000000007fff040002010c00d041030a0000000001010600021f03120a000000ffff00007fff040001043e00ef47642dc93ba041ac194d51d01b4ce63000350032003000420036003200370043003300370030003500380039003400200020002000200000007fff04000000424f00004e4f9f000000090000006f00430054003500300030004d005800350030003000530053004400310000000501090002000000007fff040002010c00d041030a0000000001010600021f03120a000500ffff00007fff040001043e00ef47642dc93ba041ac194d51d01b4ce63000320032003200320045003600410033003300300038002000200020002000200020002000200000007fff04000000424f
Boot0002* rEFInd Boot Manager   HD(1,GPT,369bdc03-e19a-4890-8630-e7a6a68e696e,0x800,0x32000)/File(\EFI\REFIND\REFIND_X64.EFI)
Boot0003* UEFI: Built-in EFI Shell      VenMedia(5023b95c-db26-429b-a648-bd47664c8012)0000424f
Boot0004* manjaro       HD(1,GPT,3350d68a-a33f-3e4b-9eb9-4d75647015d7,0x800,0x96000)/File(\EFI\manjaro\grubx64.efi)
Boot0006* Windows Boot Manager  VenHw(99e275e7-75a0-4b37-a2e6-c5385e6c00cb)
Boot0007  Unknown Device        BBS(11,,0x0)0000474f00004e4fad0000000900000063004a006500740046006c006100730068005400720061006e007300630065006e00640020003300320047004200200031003100300030000000050109000b000000007fff040002010c00d041030a00000000010106000014030506000c007fff040001043600ef47642dc93ba041ac194d51d01b4ce631003100370033005900440036004e004600510043003300430045003900350000007fff04000000424f
Boot0009  SanDisk SDSSDA240G    BBS(HD,,0x0)0000474f00004e4f9f000000090000006f00430054003500300030004d005800350030003000530053004400310000000501090002000000007fff040002010c00d041030a0000000001010600021f03120a000500ffff00007fff040001043e00ef47642dc93ba041ac194d51d01b4ce63000320032003200320045003600410033003300300038002000200020002000200020002000200000007fff04000000424f00004e4faf000000090000006f004b0049004e004700530054004f004e002000530056003300300030005300330037004100310032003000470000000501090002000000007fff040002010c00d041030a0000000001010600021f03120a000000ffff00007fff040001043e00ef47642dc93ba041ac194d51d01b4ce63000350032003000420036003200370043003300370030003500380039003400200020002000200000007fff04000000424f00004e4fa7000000090000006f0053005400310030003000300044004d003000300033002d0031004300480031003600320000000501090002000000007fff040002010c00d041030a0000000001010600021f03120a000100ffff00007fff040001043e00ef47642dc93ba041ac194d51d01b4ce620002000200020002000200020002000200020002000200031005700330044004200360045004a0000007fff04000000424f00004e4fa7000000090000006f00530061006e004400690073006b002000530044005300530044004100320034003000470000000501090002000000007fff040002010c00d041030a0000000001010600021f03120a000300ffff00007fff040001043e00ef47642dc93ba041ac194d51d01b4ce63600310037003400370035003400340034003400300031002000200020002000200020002000200000007fff04000000424f
Boot000B* UEFI: Built-in EFI Shell      VenMedia(5023b95c-db26-429b-a648-bd47664c8012)0000424f
Boot000C  Unknown Device        BBS(11,,0x0)0000474f00004e4fb30000000900000069004a006500740046006c006100730068005400720061006e007300630065006e00640020003300320047004200200031003100300030000000050109000b000000007fff040002010c00d041030a0000000001010600001a0305060001000305060006007fff040001043600ef47642dc93ba041ac194d51d01b4ce631003100370033005900440036004e004600510043003300430045003900350000007fff04000000424f
Boot000D* UEFI: JetFlashTranscend 32GB 1100     PciRoot(0x0)/Pci(0x14,0x0)/USB(12,0)/HD(2,MBR,0xb7bffb6a,0x3ac8000,0x10000)0000424f

The manjaro entry you see here doesn’t work. I used easyuefi tool in Windows and it displayed that this entry is “hidden” ?

EFI requires GPT partition schema.

Legacy or BIOS can work with both but in case of GPT special attention is required.

I guess you are using MBR - which explicitly disables EFI.

And just to remind everyone - Windows is off-topic.

did the reinstall of grub report errors?

Nope, no errors there

No the partition table is GPT
image

there is this:

ERROR: mkdir /var/lock/dmraid

but how to fix it, or if it means anything i dont know …
so run just in case these commnad:
mkinitcpio -P
update-grub

I ran
mkinitcpio -P

grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=manjaro --recheck --debug

update-grub
in that order and the error disappeared, but I still can’t see grub in the BIOS menu.

this looks lie souped up system, were you using reFind as well

did experiment with raid setup?

Your devices perhaps got raid partition type guid and therefore the system thinks it is raid?

Why do you think this is significant?

I don’t know what raid is, but everything I did is described in the first post.

That is the way one selects which bootloader to use, no ?
So if I can select grub, I should be able to boot into grub.

Yes, I installed refind since grub didn’t work and it worked for OP in this post

the mkinit command should be run after you reinstalled grub not before…
so if you start your pc into what os does it boot?
also you said that you installed windows and windows worked normally, so did you disabled fastboot in windows?

When I boot now it boots into refind, there I can currently select Windows and the live-usb.
Fastboot is disabled in the BIOS.