I shrunk my Windows partition, created an unencrypted “boot”
partition, and installed Manjaro and Pentoo on two other partitions
and chose the “encrypt” option.
As part of Manjaro’s install, a “grub.efi” file was created. I copied
that file to my unencrypted boot partition.
rEFInd finds it, and I’m able to launch the grub.efi from rEFInd, get
prompted for the LUKS password, then launch Manjaro from its grub
menu.
I want to cut out the middle man and just launch Manjaro straight from
rEFInd without going through grub.efi.
Is this possible? I am figuring Manjaro’s install did all the work
of setting up initramfs with mkinitcpio and the right encrypt hooks
since it’s working through grub.efi. I assume it’s just a matter of
getting the right kernel options/parameters into rEFInd.
Do these options look correct?
The volume is correct. I was initially getting an error about not being able to find the loader. Once I got the volume correct, that error went away. The location of the initrd and cryptdevices should be correct. I copied them from the options of the working grub config. I got them by launching into the grub.efi and then pressing “e” to edit/view the parameters. So it’s the same cryptdevice and root that the working grub is using.
Now, I see a few lines during boot that say it’s loading. The last line prints out the options that it’s loading with, the kernel parameters I guess, that it’s using that initrd and those options, and then it just freezes. I have to re-power the machine to get out of the freeze.
I dropped rEFInd a while ago because it wasn’t giving me enough options and moved to grub, but, have you had a look at the Wiki Dual boot instractions yet? That uses rEFInd too!
Looking at those Wiki Dual Boot instructions and I have everything described on that page working. I have the Manjaro/grubx64.efi file and rEFInd finds it and boots it and decrypts my luks partition and everything is good.
I don’t see any notes about what grubx64.efi does, what parameters it launches the linux kernel with, so that I can use those parameters to launch straight from rEFInd.
I don’t know about LUKS but I imagine you can achieve this by mounting the the efi partition at /boot - then assure you have the required modules in your your initramfs - by adding them to mkinitcpio.con and rebuild the images.
Thanks. By “…mounting the efi partition at /boot…” do you mean the partition with the grubx64.efi file? Because that already is mounted on an unencrypted partition at /boot, it gets found, and it boots. I’m trying to actually skip that grub efi and boot directly from refind. If that’s not the efi file you’re referencing, then which one are you talking about?
I’ll continue reading the links from that search and update this thread if I find anything that helps.
That’s the grub config that got baked into grubx64.efi. Maybe I could find the config file itself by looking at what the Manjaro install does. But this gives me a lot of info. I assume there’s a way to translate that grub config to something that works with rEFInd. I just can’t figure out what. I’m trying every combination of config parameters I can with custom rEFInd boot options.
I also see that Manjaro creates a /crypto_keyfile.bin when it performs its encryption during install. I assume Manjaro did basically what is described here, loading the crypto_keyfile.bin into initramfs using mkinitcpio: https://wiki.archlinux.org/title/dm-crypt/Device_encryption#With_a_keyfile_embedded_in_the_initramfs
I cannot figure out whether you are seasoned trying to complicate things or noob so instead of tangling myself I recommend Arch boot process - ArchWiki
Haha. Sometimes I can’t figure that out myself. I guess I’m a seasoned noob.
I just got it working so I’m going to post an update so that it gets cataloged in the internet’s archives for future seasoned noobs.
Notes:
Use mkrlconf (included with refind package) to detect your currently running linux kernel and generate a refind-linux.conf file. That file will have the options that you can copy to any manual rEFInd menuentry that you want to customize.
If you installed Manjaro to a single partition (didn’t create a separate /boot partition) and you encrypted the entire thing, then the initramfs that you see in /boot when you launch will include a crypto_keyfile.bin that can be used to unlock the luks partition. Don’t put that initramfs on an unencrypted drive! You’ll need to edit /etc/mkinitcpio.conf and remove that crypto_keyfile.bin from the FILES list and regenerate the initramfs with mkinitcpio.
Put your linux image (vmlinuz-5.10-x86_64) and your initramfs (initramfs…img) on an unencrypted drive. Those will get automatically found by rEFInd or you can manually point to them. You’ll probably also need a intel-ucode.img or amd-ucode.img as well.
Make sure your partition labels and file paths are correct. Since this is specific to your computer, there’s not much I can help with. How do you make sure something is correct if you don’t know what correct is? Some parts of rEFInd treat forward slashes and backward slashes equivalently. I think other parts of UEFI require backslashes. Try to work backwards from automatically-generated known-working configs to know what’s “correct”.
X-post with notes from the author of rEFInd: https://sourceforge.net/p/refind/discussion/general/thread/7a3e129b7f/
I’ve marked this answer as the solution to your question as it is by far the best answer you’ll get.
However, if you disagree with my choice, please feel free to take any other answer as the solution to your question or even remove the solution altogether: You are in control! (If you disagree with my choice, just send me a personal message and explain why I shouldn’t have done this or or if you agree)
P.S. In the future, please don’t forget to come back and click the 3 dots below the answer to mark a solution like this below the answer that helped you most:
so that the next person that has the exact same problem you just had will benefit from your post as well as your question will now be in the “solved” status.