Interview Prep/Linux/Boot Process & Kernel

How do you find out why a system boots slowly?

IntermediateConceptBoot Process & Kernel
Answer

In one line: Use systemd-analyze to see where boot time is spent, then look at the slowest services on the critical path.

Step by step:

systemd-analyze                 # total time: firmware + bootloader + kernel + services
systemd-analyze blame           # every service, sorted by how long it took to start
systemd-analyze critical-chain  # the chain of services that actually delayed boot

How to read the results: blame shows the slowest services, but many services start at the same time, so a slow one doesn't always delay boot. critical-chain shows the services that boot actually waited for — focus there first.

Common causes and fixes:

  • Waiting for the network (NetworkManager-wait-online or systemd-networkd-wait-online) — disable it if nothing needs the network that early.
  • A disk in /etc/fstab that isn't there — systemd waits about 90 seconds for it. Add the nofail option, or fix the entry.
  • A slow app service — check its logs with journalctl -u <service> -b.

Example: systemd-analyze blame shows NetworkManager-wait-online.service taking 30 seconds. Nothing on the server needs the network before login, so you run sudo systemctl disable NetworkManager-wait-online and boot time drops by 30 seconds.

All Linux questions Roadmap: Linux

More on Boot Process & Kernel