Speeding Up the Boot Process

In this how-to I will quickly describe how I speed up my boot from 27s to 19s using two simple changes that had no impact to my user experience at all.

Analyzing the boot process

To view how long a boot takes, we can run:

systemd-analyze

We can get a more detailed output using:

systemd-analyze plot > boot.svg
open boot.svg

However, the best way to check how the boot process can be sped up is using:

systemd-analyze critical-chain

This will show the services that slow down the boot process the most.

In my case the boot takes about 27s in total and 10.5s in userspace, of which NetworkManager-wait-online.service takes the longest and added almost 8s to the boot process.

Disabling NetworkManager-wait-online.service

NetworkManager-wait-online.service waits until a network connection is established. This is useful for remote logins or mounting remote drives, however on a normal desktop installation this is not needed. Thus it can be safely disabled using:

sudo systemctl disable NetworkManager-wait-online.service

After this change, the boot duration in userspace is reduced to about 4.5s, and the longest service is now plymouth-quit-wait.service. Disabling this service does not really help, but we can disable Plymouth all together.

Disabling Plymouth

Plymouth is responsible for showing a splash screen during the boot process. However, I never use it and kinda like seeing my computer doing stuff while it boots. Plymouth can be disable by adding rd.plymouth=0 plymouth.enable=0 to the kernel boot options.

If systemd-boot is used, this needs to be added to all entries in /boot/efi/loader/entries, for GRUB this has to be added to GRUB_CMDLINE_LINUX in /etc/default/grub. Additionally in the case of GRUB update-grub needs to be run.

After disabling plymouth, the boot duration in userspace is now only 2.5s, which is only a quarter of what I started with in the beginning.

Resources for further reading

https://askubuntu.com/a/1166492
https://askubuntu.com/a/1168249
https://wiki.archlinux.org/title/Plymouth
Thanks for reading!