optimizing system boot time on fedora26
Fedora 26 uses grub2 as default boot loader, and traditional sequential init daemon is replaced by systemd start up daemon which can start services simultaneously.
there are situations where boot times are longer than expected. Best way is to start analyzing the time taken by the process to start this can be checked by systemctl-analyze command.
#systemd-analyze
Startup finished in 2.685s (kernel) + 6.928s (initrd) + 1min 4.830s (userspace) = 2min 13.443s
The same above can be exported as an image and boot times can be investigated
#systemd-analyze plot > boot.svg
#systemd-analyze blame
37.894s abrtd.service
25.961s docker.service
18.333s tuned.service
14.288s plymouth-quit-wait.service
12.432s sssd.service
10.672s libvirtd.service
10.296s firewalld.service
9.284s NetworkManager-wait-online.service
7.816s lvm2-monitor.service
6.750s systemd-udev-settle.service
4.856s dev-sdb3.device
4.565s udisks2.service
4.276s polkit.service
4.013s initrd-switch-root.service
3.485s systemd-journal-flush.service
2.941s gssproxy.service
2.520s rsyslog.service
2.520s netcf-transaction.service
2.477s ModemManager.service
2.045s lightdm.service
1.921s dracut-initqueue.service
1.669s systemd-fsck-root.service
1.622s nagios.service
1.596s avahi-daemon.service
1.544s chronyd.service
1.461s thermald.service
1.428s systemd-vconsole-setup.service
1.300s fedora-readonly.service
1.226s sshd.service
1.203s bluetooth.service
1.123s proc-sys-fs-binfmt_misc.mount
1.107s systemd-tmpfiles-setup-dev.service
1.072s sysstat.service
1.060s dnf-makecache.service
1.056s systemd-udevd.service
844ms lm_sensors.service
802ms tmp.mount
744ms livesys.service
736ms rtkit-daemon.service
712ms switcheroo-control.service
679ms NetworkManager.service
648ms accounts-daemon.service
599ms upower.service
596ms systemd-user-sessions.service
560ms dev-mqueue.mount
509ms wpa_supplicant.service
499ms systemd-remount-fs.service
495ms auditd.service
459ms tlp.service
from the above we can see that abrtd, sssd services are taking longer duration during boot. abrtd is a crash reporting tool it is safe to disable this service if you dont want to have crash reporting enabled.
#systemctl stop abrtd
#systemctl disable abrtd
sssd service is mainly used for remote directory authentication like ldap, freeIpa services if you are not using ldap its safe to disable the service.
#systemctl stop sssd.service
#systemctl disable sssd.service
Removed /etc/systemd/system/multi-user.target.wants/sssd.service
We can even use systemd-analyze critical-chain to see the boot chain process.
$systemd-analyze critical-chain
graphical.target @1min 4.366s
└─multi-user.target @1min 4.366s
└─docker.service @38.404s +25.961s
└─network-online.target @38.396s
└─NetworkManager-wait-online.service @29.109s +9.284s
└─NetworkManager.service @27.559s +679ms
└─network-pre.target @27.556s
└─firewalld.service @17.259s +10.296s
└─polkit.service @12.820s +4.276s
└─basic.target @12.658s
└─sockets.target @12.658s
└─cockpit.socket @12.614s +43ms
└─sysinit.target @12.558s
└─systemd-update-utmp.service @12.523s +33ms
└─auditd.service @12.025s +495ms
└─systemd-tmpfiles-setup.service @11.648s +361ms
└─fedora-import-state.service @11.448s +197ms
└─local-fs.target @11.440s
└─var-lib-docker-plugins.mount @52.068s
└─local-fs-pre.target @11.006s
└─lvm2-monitor.service @3.189s +7.816s
└─lvm2-lvmetad.service @10.667s
└─lvm2-lvmetad.socket @3.184s
└─-.mount
└─system.slice
└─-.slice
Analyzing boot time after disabling services.
#systemd-analyze
Startup finished in 2.701s (kernel) + 5.342s (initrd) + 1min 12.818s (userspace) = 1min 20.861s
Related Articles
Asciinema a screen recording tool
How to use Asciinema to record and share terminal screen recordings on Linux.
Renaming lv and vg
How to rename Logical Volumes (LV) and Volume Groups (VG) in LVM on Linux.
DNS Demystified 4: Troubleshooting DNS Issues
A systematic approach to diagnosing DNS problems — from NXDOMAIN to SERVFAIL, slow resolution, and misconfigured zones.