Fixing slow boot times on fedora 27.

Have been using fedora since version 14 from my early college days, the most liked thing about fedora was the faster boot time compared to other flavous of linux distributions.

I am using a old laptop having intel core 2 duo processor , 4GB ram , intel gm965 chipset, from fedora 24 there is something unusual boot times are terribly slow taking more than 3 minutes.

Here is a boot time report generated from systemd, its taking nearly 5 minutes to complete the systemd boot process.

#sudo systemd-analyze 
Startup finished in 2.594s (kernel) + 2min 7.113s (initrd) + 2min 2.870s (userspace) = 4min 12.578s

Inspecitng dmesg logs shows error
[ 414.687273] [drm:drm_atomic_helper_wait_for_dependencies [drm_kms_helper]] *ERROR* [CRTC:41:pipe B] flip_done timed out
[ 424.927280] [drm:drm_atomic_helper_wait_for_dependencies [drm_kms_helper]] *ERROR* [PLANE:35:plane B] flip_done timed out

After browsing google found out this a bug with xorg
a detailed info about the bug can be found at
https://bugzilla.redhat.com/show_bug.cgi?id=1398424

Fixing the issue now.

#Getting the error from dmesg command.

#dmesg 

[  414.687273] [drm:drm_atomic_helper_wait_for_dependencies [drm_kms_helper]] *ERROR* [CRTC:41:pipe B] flip_done timed out
[  424.927280] [drm:drm_atomic_helper_wait_for_dependencies [drm_kms_helper]] *ERROR* [PLANE:35:plane B] flip_done timed out

#Checking boot time

#sudo systemd-analyze 
Startup finished in 2.594s (kernel) + 2min 7.113s (initrd) + 2min 2.870s (userspace) = 4min 12.578s

#sudo systemd-analyze blame
    1min 33.835s dracut-initqueue.service
    1min 15.467s plymouth-quit-wait.service
         26.412s initrd-cleanup.service
         26.400s plymouth-switch-root.service
         26.370s dkms.service
         20.990s cups.service
         18.168s NetworkManager-wait-online.service
         15.860s colord.service
         15.745s firewalld.service
         14.310s libvirtd.service
         14.127s accounts-daemon.service
         10.943s lvm2-monitor.service
         10.825s lircd-setup.service
         10.789s systemd-udev-settle.service
         10.080s dev-sdb3.device
          9.135s sensord.service
          8.534s NetworkManager.service
          7.596s ModemManager.service
          6.745s rpc-statd-notify.service
          6.637s polkit.service
          5.678s initrd-switch-root.service
          5.658s unbound-anchor.service
          4.870s systemd-journal-flush.service
          4.473s systemd-logind.service
          4.426s lm_sensors.service
          4.148s gssproxy.service
          4.104s akmods.service
          4.101s livesys.service
          3.846s udisks2.service
          3.829s wpa_supplicant.service
          3.814s rtkit-daemon.service
          3.807s avahi-daemon.service
          3.803s bluetooth.service
          3.632s ksm.service
          3.631s systemd-fsck-root.service
          3.455s netcf-transaction.service
          2.911s dnf-makecache.service
          2.864s systemd-udevd.service
          2.733s fedora-readonly.service
          2.435s systemd-tmpfiles-setup-dev.service
          1.677s upower.service
          1.393s systemd-vconsole-setup.service
           948ms lightdm.service
           915ms auditd.service
           874ms systemd-random-seed.service
           789ms chronyd.service

We need to make changes to grub2 adding video=SVIDEO-1:d to make error go away

#lets check the boot time after modifications, well the time has reduced to just about a minute

#sudo systemd-analyze 
Startup finished in 2.595s (kernel) + 4.526s (initrd) + 1min 2.493s (userspace) = 1min 9.615s
systemd-analyze critical-chain 
The time after the unit is active or started is printed after the "@" character.
The time the unit takes to start is printed after the "+" character.

graphical.target @53.018s
└─multi-user.target @53.017s
  └─libvirtd.service @31.849s +14.344s
    └─network.target @31.834s
      └─wpa_supplicant.service @36.707s +988ms
        └─dbus.service @16.916s
          └─basic.target @16.516s
            └─sockets.target @16.516s
              └─virtlockd.socket @16.515s
                └─sysinit.target @16.488s
                  └─systemd-update-utmp.service @16.444s +43ms
                    └─auditd.service @15.570s +871ms
                      └─local-fs.target @14.849s
                        └─media-data.mount @14.767s +81ms
                          └─local-fs-pre.target @14.710s
                            └─lvm2-monitor.service @4.011s +10.188s
                              └─lvm2-lvmetad.service @4.656s
                                └─lvm2-lvmetad.socket @3.917s
                                  └─-.slice

Additionally if you are not using lvm you can disable services like lvm2-monitor.service systemd-udev-settle.service NetworkManager-wait-online.service to optimmize boot times further.