Today I updated the system. The booting takes more than double the time it used to take now.
It used to take 30 sec to login screen and 30 secs after login to get the panel and desktop.
It now takes 61 seconds to login and 70 seconds after login to get desktop.
I tried to reboot once more to see if it was just setting up delay. It is not.
Any reason for this?
The time when unit became active or started is printed after the "@" character.
The time the unit took to start is printed after the "+" character.
graphical.target @27.044s
└─multi-user.target @27.044s
└─smb.service @25.946s +1.097s
└─nmb.service @25.336s +601ms
└─network-online.target @25.223s
└─NetworkManager-wait-online.service @15.940s +9.282s
└─NetworkManager.service @11.091s +4.840s
└─dbus.service @9.359s +1.720s
└─basic.target @9.355s
└─sockets.target @9.355s
└─saned.socket @9.355s
└─sysinit.target @9.243s
└─systemd-timesyncd.service @9.140s +102ms
└─systemd-tmpfiles-setup.service @8.782s +339ms
└─systemd-journal-flush.service @6.093s +2.676s
└─var-log.mount @5.766s +309ms
└─dev-disk-by\x2duuid-67e529b6\x2d3635\x2d47bd\x2da9fa\x2dcaa1106a1ae0.device @>
Had it been a long time since the last update?
Or rather, if the list of updated packages is not long, you might think about looking (e.g., in the upstream sites) for information about those updates.
Otherwise, I guess you have done more than one reboot?
I think linux-modules-cleanup.service only appears on the first reboot after a new kernel. You might see if the situation improves with a new reboot.
Otherwise, maybe I would try changing kernel, such as switching to linux-lts for a while. NetworkManager-wait-online.service could be probably disabled, see e.g. a relevant discussion here, but it's not that big time...
Apart from the suggestions provided above I can see that you are using mkinitcpio for generating initramfs. I would suggest that after trying out their suggestions you also switch to dracut from mkinitcpio. It massively improves your boot time.
Do remember to rebuild your initramfs after installing the relevant package as per the wiki instructions.
Yes. I did reboot 3 times before posting. It improved from the first time of course. But still was very slow. I will try to use dracut as suggested below and see how it helps.
This seems to have helped a little bit. After changing to dracut there was a reduction of 15 seconds or so. But I find that the linux-modules-cleanup service runs every time in both cases and while it runs in parallel, and continue to run after boot (it runs for 1.5 - 5.5 minutes), it does affect boot time. After disabling it, the speed increased by another 15-20 seconds. I am not sure if I should leave it disabled or not.
You don’t necessarily need it, but you’ll need to remember to reboot after kernel updates (which is anyway a good practice with KDE).
A few interesting insights here:
Have you tried switching to the LTS kernel, just in case…?
The problem is that if he disables the service but doesn't remove the package, the modules will continue being saved and the disk will end up filled with many residual modules on each kernel update...
@Narayanan if you want to disable that service, make sure to do the following:
systemctl start linux-modules-cleanup.service
that will clean any existent residual folder.
Then:
pacman -Rns kernel-modules-hook
This will remove the pacman hooks that are executed pre-/post-update and that will be fine.
I think I will leave the service as it is. Anyway I rarely reboot my office machine - only after updates usually. I did not know that reboot is not strictly necessary. So the boot time is not that big problem. I was just wondering why there was a sudden increase in the time.