Any ideas on how to integrate the NVMe driver into the Manjaro boot manager?

I have inherited a Dell Inspiron 3668 from a co-worker that was going to throw it away. I reinstalled Windows 10 using Dell Recovery on the existing 1 TB HDD. It is way too slow running off the HDD so I bought an SSD… unfortunately I bought a M.2 NVMe (WD Blue SN570) along with an adapter (Sabrent NVMe M.2 SSD to PCIe) but the BIOS does not seem to support this (even after updating to latest version released Nov-2021). Perhaps being a bit stubborn, I made it work using a tool called Clover EFI – it works only if I have the Clover tool installed either on a USB stick or on the HDD which loads a driver (NvmExpressDxe-64.efi) to support NVMe access… then the original boot manager can point to the SSD and boot my OS’s.

So I figured, since I’m already messing with the UEFI boot why not dual boot with Linux? I loved the live Manjaro experience and hope to make it work long term. By the way, I’ve dabbled in Linux before but it’s been a while so consider me a newbie.

My question is this: Any ideas on how to integrate the NVMe driver into the Manjaro boot manager for a more direct boot (instead of chaining boot managers like I have now)?


Step 1: Use clover to load NVMe driver


Step 2: Load boot manager to select which OS will boot

Currently, the boot process goes to Clover which allows me to choose between Windows or Linux… which then allows me to choose again using the actual boot manager. My Manjaro boot manager is already on the HDD as I had specified in setup (where it needs to be because of my inept Dell BIOS) but I can’t boot the OS directly because it doesn’t load the driver like Clover does.

That’s how I understand it anyway – please feel free to correct my noob-ness.

A related question: What is the Linux equivalent of the Windows command prompt tool bcdedit.exe?

Please forgive me if this isn’t a good place to post!

efibootmgr

This is an efi loader so copying it to the $esp usually /boot/efi would make it possible to add it directly to the efi firmware as an option.

Further info on UEFI

Thanks for the tips! I read the wiki link and several more in addition to that. I don’t necessarily understand it all but it was helpful.

I’m not sure I’m doing this correctly but I did try getting the default Manjaro boot manager to load the NVMe driver that Clover uses. The hardest part was trying to specify the driver using efibootmgr as the documentation regarding the driver option is quite brief. Here’s what I did:

  1. Logged in as su and copied the driver file that Clover uses “NvmExpressDxe.efi” to boot/efi
  2. Figured out syntax for adding driver reference (simply include -r switch to perform operations on driver):

root@john-inspiron3668:/boot/efi$ efibootmgr -r -c -l NvmExpressDxe.efi
DriverOrder: 0000
Driver0000* Linux HD(1,GPT,3522000f-d2e4-4fb7-8950-40d276d124ba,0x800,0xfa000)/File(NvmExpressDxe.efi)

  1. I then changed order (NOTE: no spaces allowed in boot var item list) to prioritize the Manjaro boot manager over Windows boot manager (which was Clover-modified so it loads the NVMe driver for me). In this way I can test to see if the Manjaro boot manager is now loading the desired driver:

root@john-inspiron3668:/boot/efi$ efibootmgr -o C,1,0,A,B,7,8
BootCurrent: 0000
Timeout: 5 seconds
BootOrder: 000C,0001,0000,000A,000B,0007,0008
Boot0000* Windows Boot Manager HD(1,GPT,3522000f-d2e4-4fb7-8950-40d276d124ba,0x800,0xfa000)/File(\EFI\CLOVER\CLOVERX64.efi)57494e444f5753000100000088000000780000004200430044004f0042004a004500430054003d007b00390064006500610038003600320063002d0035006300640064002d0034006500370030002d0061006300630031002d006600330032006200330034003400640034003700390035007d00000000000100000010000000040000007fff0400
Boot0001* Manjaro HD(1,GPT,3522000f-d2e4-4fb7-8950-40d276d124ba,0x800,0xfa000)/File(\EFI\Manjaro\grubx64.efi)
Boot0007* CD/DVD/CD-RW Drive BBS(CDROM,P1: HL-DT-ST DVD+/-RW GU90N,0x0)0000424f
Boot0008 Onboard NIC BBS(Network,Realtek PXE B02 D00,0x0)0000424f
Boot000A* ST1000DM010-2EP102 BBS(HD,P0: ST1000DM010-2EP102,0x0)0000424f
Boot000B* USB Storage Device BBS(USB,Generic MassStorageClass1209,0x0)0000424f
Boot000C* Diskette Drive BBS(Floppy,Diskette Drive,0x0)0000424f

Unfortunately this did not work. The commands in this grub rescue shell are understandably extremely limited – ls was the only command that seemed to do anything:

So then I looked at the Clover method and figured that maybe there were other drivers necessary… so I copied all of them from /boot/efi/EFI/CLOVER/drivers/UEFI to a subdirectory I created called drivers (at /boot/efi/drivers); they were the following:

ApfsDriverLoader.efi
AptioInputFix.efi
EnglishDxe.efi
Fat.efi
NvmExpressDxe.efi
OpenRuntime.efi
VBoxHfs.efi

Then created an entry for each using efibootmgr and rebooted.
Didn’t work again. In fact, this time when using the boot manager chaining method (loading my Windows Boot Manager first) I could not get Manjaro to respond to my keyboard or mouse at the login screen. This seems to indicate that the drivers are in some way being loaded (and in this case conflicting with the default Manjaro drivers). I had to use the live Manjaro USB to delete the drivers to be able to get back in.

So I tried one more time but this time with just three of the drivers that I guessed might be needed:

ApfsDriverLoader.efi
Fat.efi
NvmExpressDxe.efi

…with the order as described below:

root@john-inspiron3668:/boot/efi$ efibootmgr -r -o 0,1,2
DriverOrder: 0000,0001,0002
Driver0000* Linux HD(1,GPT,3522000f-d2e4-4fb7-8950-40d276d124ba,0x800,0xfa000)/File(.\drivers\ApfsDriverLoader.efi)
Driver0001* Linux HD(1,GPT,3522000f-d2e4-4fb7-8950-40d276d124ba,0x800,0xfa000)/File(.\drivers\Fat.efi)
Driver0002* Linux HD(1,GPT,3522000f-d2e4-4fb7-8950-40d276d124ba,0x800,0xfa000)/File(.\drivers\NvmExpressDxe.efi)

This again resulted in the grub rescue however it did not lock up my mouse and keyboard when chaining boot managers.

Any thoughts? I’m not sure this approach of guess-and-check is the best way but I haven’t yet had enough spare time to read the developer training lessons such as found here:

Another method?
What about just replacing the default Manjaro boot manager with the rEFInd boot manager? Is this difficult to manage seeing that it isn’t the boot manager installed by Manjaro?
https://www.rodsbooks.com/refind/drivers.html