Skip to content

Instantly share code, notes, and snippets.

@xbns
Last active May 27, 2022 23:45
Show Gist options
  • Save xbns/ef94096da43d9ea2c942320ad4b68dee to your computer and use it in GitHub Desktop.
Save xbns/ef94096da43d9ea2c942320ad4b68dee to your computer and use it in GitHub Desktop.
How to install rEFInd Boot Manager & bootloader
timeout 20
use_graphics_for linux
scanfor internal,external,optical,manual,firmware
dont_scan_files grubx64.efi
#include manual.conf
extra_kernel_version_strings linux-hardened,linux-zen,linux-lts,linux
## To avoid a blank white screen don't scan these directories especially when dual booting with Windows
dont_scan_volumes ad29d848-2055-42f0-911a-32304e0372e8,c2bb6aee-b3ed-4eba-9a8c-c1ca87734053,6cae04dd-d150-47c3-b379-3f5b87369be9,978d85ea-10f9-4bbc-9531-7a6886b35990
# Screen resolution
resolution 1024 768
menuentry "Arch Linux on linux-lts" {
icon /boot/efi/EFI/refind/icons/os_arch.png
volume "ArchOS"
loader /boot/vmlinuz-linux-lts
initrd /boot/initramfs-linux-lts.img
options "root=/dev/sda3 rw quiet loglevel=3 nowatchdog add_efi_memmap initrd=boot\intel-ucode.img"
ostype "Linux"
submenuentry "Boot using fallback initramfs" {
initrd /boot/initramfs-linux-lts-fallback.img
}
submenuentry "Boot to terminal" {
add_options "systemd.unit=multi-user.target"
}
disabled
}
menuentry "Windows 10" {
icon \boot\efi\EFI\refind\icons\os_win8.png
volume da223acb-203c-4b37-b729-05e1bb2e973b
loader \boot\efi\EFI\Microsoft\Boot\bootmgfw.efi
disabled
}
include themes/rEFInd-glassy/theme.conf

Install rEFInd to a Dual Boot Machine (Windows & Arch)

Note:These are rather my dirty notes on how I installed rEFIND in my workstation for future reference.

Download the package

$ sudo pacman -S refind

Assuming you already install these packages os-prober,ntfs-3g to identity our windows partition and efibootmgr

The refind-install script will identify out boot partition and install refind there.

$ sudo refind-install

This will make refind your default loader

The above script should make it default otherwise run the following one in case that did not happen.

$ sudo refind-mkdefault

Check the Partition UUIDs for your machine

$ sudo blkid

Sometimes you might need to delete a bootloader

First you have to run $ sudo efibootmgr to check your bootloaders

$ sudo efibootmgr --delete-bootnum --bootnum 5

in this case 5 here you pick it up from B0005.Last digit of the bootloader number

You can download and use a custom theme

$ sudo git clone https://github.com/Patricol/refind-material-theme.git
$ sudo echo -e 'include refind-material-theme/theme.conf' | sudo tee -a /boot/efi/EFI/refind/refind.conf

Copy these files from share directory to BOOT & refind directory so that they are located during boot

Tip: check the refind-install command script above. Otherwise run the following commands just in case.Though not needed.

$ sudo mkdir -pv /boot/efi/EFI/refind/drivers_x64    /boot/efi/EFI/BOOT/drivers_x64
$ sudo cp -v /usr/share/refind/refind_x64          /boot/efi/EFI/refind/refind_x64.efi
$ sudo cp -v /usr/share/refind/refind_x64.efi     /boot/efi/EFI/refind/refind_x64.efi
$ sudo cp -v /usr/share/refind/refind_x64.efi    /boot/efi/EFI/BOOT/bootx64.efi
$ sudo cp -v /usr/share/refind/drivers_x64/ex4_x64.efi       /boot/efi/EFI/refind/drivers_x64/ext_x64.efi
$ sudo cp -v /usr/share/refind/drivers_x64/ext4_x64.efi     /boot/efi/EFI/BOOT/drivers_x64/ext4_x64.efi
$ sudo cp /usr/share/refind/refind.conf-sample             /boot/efi/EFI/refind/refind.conf
$ sudo cp /usr/share/refind/refind.conf-sample            /boot/efi/EFI/refind/BOOT/refind.conf
$ sudo cp -vr /usr/share/refind/icons                    /boot/efi/EFI/refind/
$ sudo cp -vr /usr/share/refind/icons                   /boot/efi/EFI/BOOT/

Troubleshooting

Check line dont_scan_volumes

You only need to scan the volumes where EFI Partitions are found i.e /boot/efi as in my case for Arch and partition /dev/sda6 for Window(my windows EFI Partition is here) but installed in dev/sda8.lol

The rest disable so that the bootloader does not spend time scanning those. Otherwise if not you get a blank screen with only refind logo!

Note: After you reboot your machine, you may see many other bootloader that were loaded and you may wish to have them hidden. Select one after the other then hit Del key, when prompted to remove them select yes.Technically they are not removed from your machine but rather hidden for rEFInd. You should now be left with Windows & Arch only.

"Boot to graphical " "rw root=UUID=ca41b6c7-b783-4254-8f09-1878f902673b" initrd=/boot/initramfs-linux-lts.img quiet loglevel=3 udev.log-priority=3"
"Boot to terminal" "rw root=UUID=ca41b6c7-b783-4254-8f09-1878f902673b systemd.unit=multi-user.target"
"Boot to single-user mode" "rw root=UUID=ca41b6c7-b783-8f09-1878f902673b single"
"Boot with minimal options" "ro root=LABEL=ArchOS"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment