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-onlineorsystemd-networkd-wait-online) — disable it if nothing needs the network that early. - A disk in
/etc/fstabthat isn't there — systemd waits about 90 seconds for it. Add thenofailoption, 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.
More on Boot Process & Kernel
Walk through the Linux boot process from power-on to login prompt.BeginnerWhat is the difference between BIOS and UEFI booting?IntermediateWhat does GRUB2 do and where is its configuration?BeginnerWhat is the initramfs and why is it needed?AdvancedHow do you view and change kernel command-line parameters?IntermediateWhat is systemd and why did it replace SysV init?Beginner