rEFInd takes too long (a lot longer than grub) to load at boot

I spent the last 3 hours setting up and configuring rEFInd.
To be honest, the installation itself took only 5 minutes, with most of the time spent in /boot/refind_linux.conf
However, rEFInd takes 3 seconds to load while grub loads instant, no matter what I try.
I tried:

  • disabling tool detection with an empty showtools entry
  • adding all non-relevant partitions to dont_scan_volumes
    ** I even added the linux-Partition to it, so that it only found the Windows-boot entry
  • enabled and increased the log level - the only effect was, that it now took 5-6 seconds to load rEFInd, the log showed no issues
  • used textonly mode
  • limited scanfor to only the essential parts
  • enable/disable Fastboot

I am certain that it really takes 3 seconds to load rEFInd and not just 3 seconds for the screen to change the resolution, because the configured timeout starts with the expected value after 3 seconds of black screen which comes after the UEFI boot sequence (where grub appeared instantly).

Inxi
System:
  Kernel: 5.19.4-arch1-1 arch: x86_64 bits: 64 compiler: gcc v: 12.2.0
    Desktop: KDE Plasma v: 5.25.4 tk: Qt v: 5.15.5 wm: kwin_x11 dm: SDDM
    Distro: EndeavourOS base: Arch Linux
Machine:
  Type: Desktop Mobo: ASUSTeK model: ROG STRIX X470-F GAMING v: Rev X.0x
    serial: <superuser required> UEFI: American Megatrends v: 6042
    date: 04/28/2022
CPU:
  Info: 8-core model: AMD Ryzen 7 2700X bits: 64 type: MT MCP arch: Zen+
    rev: 2 cache: L1: 768 KiB L2: 4 MiB L3: 16 MiB
  Speed (MHz): avg: 2674 high: 4316 min/max: 2200/3700 boost: enabled
    cores: 1: 3700 2: 2200 3: 2200 4: 1715 5: 2200 6: 2200 7: 4316 8: 2162
    9: 3700 10: 3700 11: 3700 12: 2200 13: 2200 14: 2200 15: 2200 16: 2200
    bogomips: 118454
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm
Graphics:
  Device-1: AMD Navi 22 [Radeon RX 6700/6700 XT/6750 XT / 6800M]
    vendor: Sapphire driver: amdgpu v: kernel arch: RDNA-2 pcie: speed: 16 GT/s
    lanes: 16 ports: active: DP-1 empty: DP-2,DP-3,HDMI-A-1 bus-ID: 0b:00.0
    chip-ID: 1002:73df
  Device-2: Logitech HD Webcam C615 type: USB
    driver: snd-usb-audio,uvcvideo bus-ID: 5-1.1:4 chip-ID: 046d:082c
  Display: x11 server: X.Org v: 21.1.4 with: Xwayland v: 22.1.3
    compositor: kwin_x11 driver: X: loaded: amdgpu unloaded: modesetting
    alternate: fbdev,vesa gpu: amdgpu display-ID: :0 screens: 1
  Screen-1: 0 s-res: 2560x1440 s-dpi: 96
  Monitor-1: DP-1 mapped: DisplayPort-0 model: Acer XF270HU res: 2560x1440
    dpi: 109 diag: 685mm (27")
  OpenGL: renderer: AMD Radeon RX 6750 XT (navy_flounder LLVM 14.0.6 DRM
    3.47 5.19.4-arch1-1) v: 4.6 Mesa 22.1.7 direct render: Yes
Audio:
  Device-1: AMD Navi 21/23 HDMI/DP Audio driver: snd_hda_intel v: kernel
    bus-ID: 5-1.1:4 pcie: speed: 16 GT/s chip-ID: 046d:082c lanes: 16
    bus-ID: 0b:00.1 chip-ID: 1002:ab28
  Device-2: AMD Family 17h HD Audio vendor: ASUSTeK driver: snd_hda_intel
    v: kernel pcie: speed: 8 GT/s lanes: 16 bus-ID: 0d:00.3 chip-ID: 1022:1457
  Device-3: Logitech HD Webcam C615 type: USB
    driver: snd-usb-audio,uvcvideo
  Sound Server-1: ALSA v: k5.19.4-arch1-1 running: yes
  Sound Server-2: PulseAudio v: 16.1 running: no
  Sound Server-3: PipeWire v: 0.3.56 running: yes
Network:
  Device-1: Intel I211 Gigabit Network vendor: ASUSTeK driver: igb v: kernel
    pcie: speed: 2.5 GT/s lanes: 1 port: e000 bus-ID: 07:00.0
    chip-ID: 8086:1539
  IF: enp7s0 state: up speed: 1000 Mbps duplex: full mac: <filter>
Drives:
  Local Storage: total: 4.55 TiB used: 2.91 TiB (64.0%)
  ID-1: /dev/nvme0n1 vendor: Samsung model: SSD 960 EVO 500GB
    size: 465.76 GiB speed: 31.6 Gb/s lanes: 4 serial: <filter> temp: 40.9 C
  ID-2: /dev/nvme1n1 vendor: Samsung model: SSD 970 EVO 500GB
    size: 465.76 GiB speed: 31.6 Gb/s lanes: 4 serial: <filter> temp: 40.9 C
  ID-3: /dev/sda vendor: Samsung model: SSD 870 EVO 4TB size: 3.64 TiB
    speed: 6.0 Gb/s serial: <filter>
Partition:
  ID-1: / size: 57.37 GiB used: 37.79 GiB (65.9%) fs: ext4
    dev: /dev/nvme0n1p2
  ID-2: /boot/efi size: 147.7 MiB used: 7.3 MiB (4.9%) fs: vfat
    dev: /dev/nvme0n1p1
  ID-3: /home size: 391.78 GiB used: 284.28 GiB (72.6%) fs: ext4
    dev: /dev/nvme0n1p4
Swap:
  ID-1: swap-1 type: partition size: 7.91 GiB used: 0 KiB (0.0%) priority: -2
    dev: /dev/nvme0n1p3
Sensors:
  System Temperatures: cpu: 51.0 C mobo: 39.0 C gpu: amdgpu temp: 43.0 C
    mem: 40.0 C
  Fan Speeds (RPM): cpu: 530 case-1: 746 case-2: 691 case-3: 721
    gpu: amdgpu fan: 0
  Power: 12v: 12.03 5v: N/A 3.3v: N/A vbat: N/A
Info:
  Processes: 327 Uptime: 15m Memory: 31.25 GiB used: 2.27 GiB (7.3%)
  Init: systemd v: 251 default: graphical Compilers: gcc: 12.2.0
  clang: 14.0.6 Packages: pacman: 1637 Shell: Zsh v: 5.9 running-in: yakuake
  inxi: 3.3.20

rEFInd, like grub, is installed on the EFI-Partition on the Samsung SSD 960 EVO 500GB, the Windows-EFI-Partition is on the Samsung SSD 970 EVO 500GB

What else could I try in order to improve load time of rEFInd?
If nothing helps, I will give up on it and return to grub as default bootloader.

I never had this problem with rEFInd but i also never made any changes in the .conf file. I just install it and set it to use an Icon of my choice.

well how do you load your CPU microcode then?
I only followed that guide here: https://discovery.endeavouros.com/grub-and-refind/how-to-install-refind/2021/03/
which enabled the icon through copying it to rEFInd directory - and enabled CPU microcode loading. The later only happens after rEFInd is loaded, so it should not slow down anything while booting rEFInd. The first is not a big file and only a very small addition to the already present ones, so that should not slow down anything, too.

The first reboot with those modifications was already too slow.

All the other things I did afterwards trying to speed up the loading, but nothing solved the slow boot process.

Edit: undid the logo copying, it’s not the cause.

I’ve used rEFInd for a while and have had no issues. I don’t change any of the .conf file to use it. The icon that comes up is for booting grub or the vmlinuz-linux image. So at this point only rEFInd has loaded a splash screen with a menu. When you select the Icon to boot it’s either grub or the image. So after choosing one it boots via grub or the image file. So I’m not sure if you are saying that the splash screen takes too long to load or are you talking about when you start the boot process because the splash screen should just load when you boot the computer. If it’s your computer taking too long to boot up to this point of the rEFInd splash screen i don’t know why that would be.

so you don’t load your microcode at all which itself is not ideal …

to make it clear, Power on the computer → UEFI screen → GRUB or rEFInd screen → OS starts loading.
the time it takes for rEFInd to appear is 3 seconds, while GRUB appears instantly after the UEFI screen. The OS itself loads as fast as ever.

I am not booting grub out of UEFI, I load the image file directly.

With GRUB and a timeout of 2 seconds, it takes about 25 seconds from power on to fully usable Desktop, therefore the added 3-4 seconds with rEFInd and a 2 second timeout are more than 10% boot time extension which I want to get rid of or switch back to grub.

The microcode is loaded when the computer boots. Not sure what you mean. I don’t have any slow boot up with rEFInd.

Edit: With rEFInd it’s about 30 seconds from pushing the power button.

according to the guide I posted above, you have to add initrd=\boot\amd-ucode.img into the refind_linux.conf file (and replace amd with intel in case one has an Intel CPU):

"Boot using default options"     "root=UUID=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX rw add_efi_memmap initrd=\boot\amd-ucode.img initrd=\boot\initramfs-%v.img"

The same is done in grub when generating its config, but there it is done automatically:

Found initrd image: /boot/amd-ucode.img /boot/initramfs-linux.img

grub.cfg:

        echo    'Loading kernel linux ...'
        linux   /boot/vmlinuz-linux root=UUID=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX rw  loglevel=3 quiet
        echo    'Loading initial ramdisk ...'
        initrd  /boot/amd-ucode.img /boot/initramfs-linux.img

For my CPU, it does not make a difference because the UEFI already contains the newest microcode available, but in general, it should be added or the microcode does not load which is insecure.

well, just to check, I have reverted both /boot/refind_linux.conf and /boot/efi/EFI/refind/refind.conf to its original state (I always make backups of the files before I tamper with them) - rEFInd still takes 3 seconds to display -.-

Why wouldn’t it load if I’m booting from grub? rEFInd doesn’t boot the computer. It’s just a boot manager. The ucode is loaded when the boot process happens after i select to boot from rEFInd.

so you only use rEFInd to load grub on your computer? In that case, it is ok to let grub load the microcode.
I want to replace grub with rEFInd, therefore rEFInd has to load the microcode.

So you mean then you are booting from the vmlinuz-linux image file?

I think we run in circles, so let me try to get out of that circle … my problem is with rEFInd taking to long to load after UEFI has finished - before the OS itself starts loading:

You said to not modify config files - I explained why think I have to modify them and what exactly I did. Loading the vmlinuz-linux image file is not my issue, the part AFTER rEFInd works as fast as ever and rEFInd finds and loads all installed vmlinuz-linux-* files.

I undid all modifications to the config files. rEFInd still takes the same time to load (3 seconds vs instantly loading grub).

edit:
it actually is more than 3 seconds:
Grub boot:

systemd-analyze 
Startup finished in 13.402s (firmware) + 1.557s (loader) + 4.967s (kernel) + 1.508s (userspace) = 21.435s

rEFInd boot:

systemd-analyze 
Startup finished in 13.447s (firmware) + 7.147s (loader) + 4.978s (kernel) + 1.536s (userspace) = 27.110s

both with a 2 second timeout that I let run out for comparability.

This is using rEFInd on my system and I’m okay with it.

[ricklinux@eos-kde ~]$ systemd-analyze 
Startup finished in 17.580s (firmware) + 13.068s (loader) + 2.047s (kernel) + 1.561s (userspace) = 34.257s 
graphical.target reached after 1.544s in userspace.

Edit: I will agree with you it does take a bit longer to boot using rEFInd. Here is grub boot without rEFInd.

[ricklinux@eos-kde ~]$ systemd-analyze 
Startup finished in 16.715s (firmware) + 6.412s (loader) + 2.032s (kernel) + 2.063s (userspace) = 27.225s 
graphical.target reached after 2.057s in userspace.

Thanks. So I am definitely not alone with that phenomenon that rEFInd takes about 20% longer to boot compared with grub.

1 Like