Menu

Preparing to use rEFInd for dual-booting, things I should know

No Name
2017-11-20
2017-11-20
  • No Name

    No Name - 2017-11-20

    I have a computer with two hard drives, which came pre-installed with Windows 10 on the first hard drive and Windows Boot Manager loads it by default when computer starts. I am planning to keep Windows alive, but also install Linux on the second hard drive (I also want to make an EFI partition there as well, to avoid interacting with the first drive at all), boot it, install rEFInd there, then run refind-mkdefault to make rEFInd the default boot manager.

    So far I have installed Linux in a VirtualBox VM, with just one hard drive, then rEFInd. Even if I have run refind-mkdefault, when I restart the VM, I have to enter UEFI everytime, pick "Boot from file" then navigate to rEFInd's .efi file to launch it. Then it detects elilo.efi and runs it fine. This problem is of minor importance for my real setup I suppose.

    Regarding dual-boot, when I will install Linux to sdb, boot it, then run refind-install, will it know to install itself to the EFI partition from sdb or should I tell it to do that explicitly via certain command line arguments?

    After that, if I run refind-mkdefault, do I get rEFInd to boot first after each computer restart and let me choose between Windows Boot Manager on sda and Linux elilo on sdb?

    Am I missing anything else?

     
  • Roderick W. Smith

    VirtualBox does a poor job of "remembering" its EFI settings across boots, particularly if you completely shut down the VM between boots. This makes it work much like a computer with a broken NVRAM. You may want to check the following sections of the rEFInd documentation for advice on this type of system:

    Personally, I used to use the fallback filename (EFI/BOOT/bootx64.efi) directly, and rEFInd's mvrefind script can help set that up, as described in the first link. More recently, I've been relying more on the fbx64.efi program, as described in the second link. Either method works fine.

    Concerning the drive to which refind-install installs, it will install to whatever partition is mounted at /boot/efi or /boot, providing it uses FAT. If refind-install detects no FAT partition mounted at either location, it will attempt to locate the ESP, and will install to the first one it finds. Chances are that would be an ESP on /dev/sda, but that's not 100% guaranteed. In your case, you should ensure that you mount your ESP at /boot/efi or /boot and the script should do what you want.

    Note that the RPM and Debian packages I distribute run refind-install automatically as part of the installation process, so you should mount your ESP before you install one of these packages. If you install via a .zip file, of course, you'll have to either run refind-install yourself or install manually. Also, the Debian package in the Ubuntu PPA runs refind-install only if you answer "yes" to the question about installing to the ESP.

    There should be no need to run refind-mkdefault after running refind-install; the latter should set up rEFInd as the default boot program. Note the word "should," though; EFIs are still notoriously idiosyncratic, and many are unreliable. You might install and, as with VirtualBox, find that your settings don't "stick" across reboots, or they might not be created at all.

    Incidentally, ELILO is no longer being maintained, AFAIK. It should still work, but there's little point to using it, IMHO. It's better to have rEFInd launch your kernels directly (they'll need to have the EFI stub loader compiled into them; but most pre-compiled kernels have this already) or perhaps boot through GRUB 2 if you need some unusual feature it provides.

     

Log in to post a comment.