You are not logged in.

#1 2025-10-21 21:27:01

notaballer
Member
Registered: 2025-10-20
Posts: 4

I am trying to lower my boot up time.

My setup:
device: thinkpad t14 gen 1
CPU: ryzen 5 4650u
memory: 16gb sodimm ddr4
GPU: rx vega 6 (intigrated graphics)
Window compositor: wayland
Desktop environment: KDE
Storage: samsung 512gb gen 3 NVMe

Boot configuration:
boot loader: EFI boot stub
Greeter: Ly
encryption: LUKS
disk layout: separate partitions for root and home
initframfs: xz
setup: UEFI

my problem: boot time is too long
systemd-analyze output:
Startup finished in 6.373s (firmware) + 195ms (loader) + 16.527 s (kernel) + 5.877s (userspace) = 28.972s
graphical.target reached after 5.876s in userspace.

(note that most of the time in the 'kernel' section is me entering a password to decrypt my drive).

systemd-analye blame output:
2.125s systemd-cryptsetup@home.service
1.010s NetworkManager.service
770ms systemd-fsck@dev-disk-by\x2duuid-1897c2f4\x2daa13\x2d476e\x2d99a7\x2db08fb84480c2.service
652ms dev-mapper-root.device
430ms systemd-udev-trigger.service
262ms user@1000.service
255ms upower.service
203ms udisks2.service
173ms systemd-journald.service
168ms ldconfig.service
123ms systemd-tmpfiles-setup-dev-early.service
114ms systemd-tmpfiles-setup.service
102ms boot.mount
100ms power-profiles-daemon.service
100ms systemd-udevd.service


things being hooked during initialization: keymap, udev, encrypt

target: sub 20sec boot time

note: i do not use TPM2 keys. I am not willing to reduce iteration time for my disk encryption. I am not willing to combine root and home partitions into one.

Any help would be greatly appreciated!

Last edited by notaballer (2025-10-22 12:26:44)

Offline

#2 2025-10-22 05:51:31

unixman
Member
Registered: 2015-03-12
Posts: 181

Re: I am trying to lower my boot up time.

Hi. Change acoordingly if fits you.

Greeter: Ly           --> None(direct to desktop)
initframfs: xz       ---> none(raw cpio)
kernel: xz            ---> gz(if in case)

cut down initrd as left only disk, fs, keyboard drivers.
remove allmost all mkinitrd hooks(left only 'base')
put module names manually.
(WARNING: maybe unbootable)

Phase out grub or whatever.
add a boot entry to firmware  to point  vmlinuz and cmdline.
(dont forget leave one more entry as fallback)

disable fancy stuff in BIOS if you dont use or rarely. eg KVM stuff

Last edited by unixman (2025-10-22 05:56:17)

Offline

#3 2025-10-22 06:59:00

-thc
Member
Registered: 2017-03-15
Posts: 1,020

Re: I am trying to lower my boot up time.

For comparison the values of my secondary UEFI PC (11 year old mainboard, 14 year old desktop ssd)

Startup finished in 4.851s (firmware) + 4.836s (loader) + 1.939s (kernel) + 3.059s (userspace) = 14.687s 
graphical.target reached after 3.059s in userspace.
1.064s dev-sda5.device
 503ms systemd-journal-flush.service
 492ms NetworkManager.service
 386ms systemd-udev-trigger.service
 340ms cups.service
 202ms user@1000.service
 173ms accounts-daemon.service
 163ms systemd-journald.service
 156ms systemd-tmpfiles-setup-dev-early.service
 133ms ldconfig.service
 129ms udisks2.service
 118ms systemd-tmpfiles-setup.service
 116ms dev-hugepages.mount
[...]

Directly loading the kernel would lead to a boot time below 10 seconds.
Be aware that the "blame" command only analyzes the "userspace" time and your "kernel" time is definitively too log.
Most of the "userspace" time is consumed by your crypt setup - which looks O.K. to me (but I'm no expert on that).

Please post a complete boot journal to analyze the kernel boot time.

Offline

#4 2025-10-22 08:05:03

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 70,049

Re: I am trying to lower my boot up time.

Startup finished in 6.373s (firmware) + 195ms (loader) + 16.527 s (kernel) + 5.877s (userspace) = 28.972s
graphical.target reached after 5.876s in userspace.

(note that most of the time in the 'kernel' section is me entering a password to decrypt my drive, real time without me entering the password would be ~1 minute less).

target: sub 20sec boot time

The values are somewhat falling apart here.
Please post your complete system journal for the boot:

sudo journalctl -b | curl -F 'file=@-' 0x0.st

and

dmesg | curl -F 'file=@-' 0x0.st

Offline

#5 2025-10-22 12:38:21

notaballer
Member
Registered: 2025-10-20
Posts: 4

Re: I am trying to lower my boot up time.

Question to unixman (and everyone else):

Is there a point in removing Ly? it is very light-weight, and doesn't account for much time. I think that it will make the total boot up time only longer for me since i will have to enter my login and a command to boot into GUI manually. Also, is removing initramfs a good idea? I thought that it is mandatory to have initramfs, as it is used to detect hardware and perform other tasks during boot up. What i was considering instead is using Lz4?

Another question: Is switching to Unified Kernel Images a good idea for reducing boot time and increasing system integrity/ security? As i understand it, it reduces time if i am using secure boot, since it is generated during install?

Offline

#6 2025-10-22 13:31:27

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 70,049

Re: I am trying to lower my boot up time.

Ly traditionally has (had?) issues w/ breaking the logind (session dbus) integration but it'll only slow down your login when that happens (and by 25s each call)
nb. that this might have meanwhile be fixed.

https://wiki.archlinux.org/title/Unified_kernel_image skips the bootloader and replaces the initramfs, but excluding that (bootloader time) will rather not lead to meaningful boot acceleration (because you still need to load/start that stuff somehow)
Grub might however be extremely slow if you encryted the /boot partition

I'd suggest to abort the micro-optimizing, post bootloader - initramfs to graphical target - you're looking for maybe 4 seconds of boot time. If this takes >> 20s, you've some major issue somewhere and that's not necessarily reflected by

Startup finished in 6.373s (firmware) + 195ms (loader) + 16.527 s (kernel) + 5.877s (userspace) = 28.972s
graphical.target reached after 5.876s in userspace.
(note that most of the time in the 'kernel' section is me entering a password to decrypt my drive).

Offline

#7 2025-10-22 13:32:35

unixman
Member
Registered: 2015-03-12
Posts: 181

Re: I am trying to lower my boot up time.

Q:Is there a point in removing Ly?
A: i means autologin w/o bothering passords.

Q:Also, is removing initramfs a good idea?
A:i recomments cut down / slim down as baytes not remove.
Ahh my english uggly i know.

Offline

#8 2025-10-23 02:15:46

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,501

Re: I am trying to lower my boot up time.

All English is ugly -- it is a compilation of the languages of everyone that has ever invaded Great Britain wink


What is the output of systemd-analyze critical-chain    ?


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#9 2025-10-23 02:20:43

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,171

Re: I am trying to lower my boot up time.

Your problem is in the kernel initialization, so it's almost certainly some hardware you have holding things up. Unplug everything you can and see if the kernel time goes down.

Offline

Board footer

Powered by FluxBB