GRUB2 takes too long to load the necessary files, by this I mean the time from selecting a fedora kernel to the LUKS prompt appearing.
This problem actually started way back, when I finally upgraded to a SATA SSD from an HDD, which made boot slower for Linux, and my patience finally ran out.
As for the exact numbers:
Output of systemd-analyze time:
Startup finished in 7.106s (firmware) + 1min 17.573s (loader) + 1.322s (kernel) + 34.012s (initrd) + 13.299s (userspace) = 2min 13.314s
graphical.target reached after 13.299s in userspace.
now using a chronometer, I found that the time from selection of boot entry to LUKS prompt is approx. 1m 26s, with most time being wasted on GRUB loading files.
As for the file sizes:
initramfs weighs 139mb despite being made with --host-only
vmlinuz is at 17mb
Please remember that even an HDD did not struggle loading these sizes on GRUB, this is a healthy SSD and reading these files is supposed to take a fragment of a second:
❯ sudo time cat initramfs-6.19.11-200.fc43.x86_64.img vmlinuz-6.19.11-200.fc43.x86_64 >/tmp/something
0.00user 0.05system 0:00.05elapsed 98%CPU (0avgtext+0avgdata 2228maxresident)k
0inputs+0outputs (0major+215minor)pagefaults 0swaps
When I was on Void Linux, I worked around this by crafting a feather-light 2mb initrd and used EFI-stub (the heavy initrd did not play well with EFI stub either), however that only worked because init was simple and no LUKS or systemd was involved, not to mention whatever Fedora uses for offline upgrades.
I don’t know if this is the right place to post this, as I am very sure this isn’t exclusive to Fedora, but an issue with GRUB, I did not find a proper place for posting such problems.
Sorry for the long post, this is just years of frustration with windows11-on-hdd levels of boot slowness.
What should I do to solve this boot time problem?
Any help would be appreciated, and thank you.
some extra informations about the computer:
System:
Kernel: 6.19.11-200.fc43.x86_64 arch: x86_64 bits: 64
Desktop: KDE Plasma v: 6.6.4 Distro: Fedora Linux 43 (KDE Plasma Desktop
Edition)
Machine:
Type: Desktop Mobo: ASRock model: H310M-DGS serial: <superuser required>
Firmware: UEFI vendor: American Megatrends v: P3.00 date: 07/16/2018
CPU:
Info: 6-core model: Intel Core i5-8400 bits: 64 type: MCP cache: L2: 1.5 MiB
Speed (MHz): avg: 800 min/max: 800/4000 cores: 1: 800 2: 800 3: 800 4: 800
5: 800 6: 800
Graphics:
Device-1: NVIDIA GP107 [GeForce GTX 1050 Ti] driver: nvidia v: 580.126.18
Display: wayland server: Xwayland v: 24.1.9 compositor: kwin_wayland
driver: gpu: nvidia,nvidia-nvswitch
Drives:
ID-1: /dev/sda vendor: TeamGroup model: T253256GB size: 238.47 GiB
Info:
Memory: total: 16 GiB available: 15.53 GiB used: 6.78 GiB (43.7%)
Processes: 415 Uptime: 1h 11m Shell: Bash inxi: 3.3.40
grub version:
❯ dnf repoquery --installed 'grub2*'
grub2-common-1:2.12-43.fc43.noarch
grub2-efi-ia32-1:2.12-43.fc43.x86_64
grub2-efi-ia32-cdboot-1:2.12-43.fc43.x86_64
grub2-efi-x64-1:2.12-43.fc43.x86_64
grub2-efi-x64-cdboot-1:2.12-43.fc43.x86_64
grub2-efi-x64-modules-1:2.12-43.fc43.noarch
grub2-pc-1:2.12-43.fc43.x86_64
grub2-pc-modules-1:2.12-43.fc43.noarch
grub2-tools-1:2.12-43.fc43.x86_64
grub2-tools-efi-1:2.12-43.fc43.x86_64
grub2-tools-extra-1:2.12-43.fc43.x86_64
grub2-tools-minimal-1:2.12-43.fc43.x86_64