Troubleshooting Slow Boot Times with systemd-analyze
A Linux system that takes several minutes to become usable usually has a specific bottleneck rather than a generally “slow” operating system. A failed mount, delayed network service, hardware timeout, or misconfigured startup unit can hold the boot process while the screen appears idle.
systemd-analyze provides a practical way to measure that delay on systemd-based distributions, including Fedora, RHEL, CentOS Stream, and many modern server installations. It shows how long the kernel, initrd, userspace, and individual units take to start.
This approach is useful on an office workstation in Sydney, a VPS hosted in an Australian data centre, or a home lab running on an older NBN connection. The same commands work locally or through SSH, although remote troubleshooting should be performed carefully if networking itself is part of the problem.
Before changing services, record the current boot timing and inspect the logs. A measured diagnosis is safer than disabling units at random, particularly on production servers that provide DNS, web hosting, monitoring, or database services.
Measure The Boot Sequence
Begin with the overall timing:
systemd-analyze
A typical result may look like this:
Startup finished in 4.812s (kernel) + 8.205s (initrd) + 19.442s (userspace) = 32.459s
graphical.target reached after 19.401s in userspace
The userspace figure includes services launched by systemd. A large kernel value can indicate hardware detection or storage problems, while a long initrd phase may point to disk discovery, LVM, encrypted volumes, or an unavailable root device.
For a visual dependency timeline, run:
systemd-analyze plot > boot.svg
Copy boot.svg to a desktop machine and open it in a browser. The chart makes overlapping services and long-running units easier to identify than a plain command-line summary.
Find Services That Delay Startup
Use blame to list units by startup duration:
systemd-analyze blame
This command often highlights services such as NetworkManager-wait-online.service, dnf-makecache.service, disk mounts, cloud-init, or a hardware-related daemon. A service at the top is worth investigating, but it is not automatically the root cause: some services run in parallel and do not block the target needed for login.
For dependency-aware analysis, check the critical chain:
systemd-analyze critical-chain
This shows the sequence of units that directly delayed a target. If a mount waits for a device that never appears, the chain may reveal the relationship between local-fs.target, dev-*.device, and mount units.
A common Australian laptop scenario involves a stale /etc/fstab entry for an external drive that is disconnected at a café or while travelling between Melbourne and regional areas. Test entries with nofail,x-systemd.device-timeout=5s where appropriate, rather than allowing a missing non-essential disk to block boot for 90 seconds.
Inspect Failed Units And Logs
List units that failed during the current boot:
systemctl --failed
Then inspect a suspicious unit and its recent messages:
systemctl status example.service
journalctl -b -u example.service
Replace example.service with the actual unit name. The -b option limits journal output to the current boot; use journalctl -b -1 to review the previous boot if the system has restarted since the problem occurred.
For broader errors and warnings, use:
journalctl -b -p warning
journalctl -k -b
Look for phrases such as “timed out”, “dependency failed”, “emergency mode”, “failed to mount”, or repeated network retries. On a server in Perth or Brisbane, a slow DNS response can make network-dependent services appear to be the cause when the real issue is resolver configuration or an unreachable internal hostname.
Check Network, Storage, And Services
Network waiting is a frequent source of apparent boot slowness. Check the state and enablement of the wait service:
systemctl status NetworkManager-wait-online.service
systemctl is-enabled NetworkManager-wait-online.service
Do not disable it blindly. Applications that require an active network before starting may fail if the service is removed. Instead, examine connection profiles, DHCP behaviour, DNS servers, and interface names. On Australian cloud platforms, confirm that the instance’s metadata, virtual NIC, and assigned hostname are available as expected.
Storage problems deserve equal attention:
systemctl list-jobs
findmnt --verify
lsblk -f
findmnt --verify can expose invalid mount definitions, while lsblk -f helps match UUIDs in /etc/fstab with actual devices. Review recent kernel messages for I/O errors:
dmesg -T | grep -Ei 'error|timeout|reset|fail'
A failing SATA disk, USB enclosure, or virtual block device can create delays that no systemd service optimisation will solve.
Apply Safe Changes And Verify
After identifying the cause, make the smallest suitable change. A service can be disabled from automatic startup with:
sudo systemctl disable --now service-name.service
Before doing this, determine whether another unit depends on it:
systemctl list-dependencies multi-user.target
systemctl list-dependencies --reverse service-name.service
For a unit that should remain available but start later, an override may be safer than editing a vendor file:
sudo systemctl edit service-name.service
Add only a deliberate setting, save the file, then reload systemd:
sudo systemctl daemon-reload
Legacy software can complicate diagnosis when old compatibility packages or custom startup scripts are involved; a reference such as the DOS/4GW reference may help identify what a historical component is intended to do before it is removed.
Reboot during a maintenance window and measure again:
sudo systemctl reboot
systemd-analyze
systemd-analyze blame | head -20
Keep a note of the original and revised timings. Administrators preparing for technical interviews can also use these commands alongside Linux troubleshooting material in Linux interview questions, where boot targets, journals, and service dependencies commonly appear.
Start with systemd-analyze, identify the critical chain, verify the related journal entries, and change one configuration item at a time before measuring the next boot.