I am trying to improve / optimize my boot time and needed some help analyzing the systemd-analyze blame results. Just for some background, I have a 2016 Dell XPS 13 (9350) with an i5 Skylake Processor and 8GB of ram. The output is below:
Startup finished in 14.208s (firmware) + 4.747s (loader) + 1.115s (kernel) + 1min 40.103s (userspace) = 2min 174ms
graphical.target reached after 1min 39.842s in userspace
nmb.service certainly seems to be the major culprit in slowing down the boot process. I don’t know whether you need that or not, but it’s for connecting your machine to a Windows network.
If you don’t need that, then you can disable and/or mask it, and then I would also advise disabling NetworkManager-wait-online.service, which is also known to slow down the boot process, and in this case, possibly related to nmb.service.
The other two below that are tasks that are periodically run ─ respectively, trimming the unused blocks of your SSD and updating the database of files on your system ─ but that could not be run when they were scheduled because the system was shut down, and so they are then run upon the next boot instead.
fsrim.service is normally run once a week, by fstrim.timer, and updatedb.service is normally run every 24 hours, by updatedb.timer. Both usually run at midnight.
In addition, if you have any details (or can point me to any documentation) on how to disable the nmb.service, I can go ahead and take care of that one. I do NOT need to connect to a Windows network at all under my Manjaro installation.
Thanks again for your time and help, it is SUPER appreciated!
It was a typographical error on my part ─ sorry, I’m fighting Covid-19 again at the moment ─ and I’ve corrected it in my previous post.
You’ve already disabled it now, so now all you still need to do is mask it, like so…
sudo systemctl mask nmb.service
You could eventually do the same with NetworkManager-wait-online.service. I have that masked on my system here as well, but this is a desktop, connecting to the internet via a UTP cable. If you need wireless networking, then maybe you need to keep that one active.
Thanks for the update @Aragorn! I went ahead and disabled the NetworkManager-wait-online.service as well. I do have a laptop, so I guess if there are issues, I’ll go back and enable the service if needed.
After disabling both nmb.service and NetworkManager-wait-online.service and doing a fresh reboot, this is the current output:
[aahmad@aahmad-pc ~]$ systemd-analyze
Startup finished in 8.089s (firmware) + 1.862s (loader) + 1.031s (kernel) + 4.978s (userspace) = 15.962s
graphical.target reached after 4.706s in userspace
Those are very good results. I think you should leave it at that.
At the moment, I’m feeling pretty bad. It’s a horrible disease. But hey, it’s not like anyone asked me whether I wanted to get infected. I got infected because other people than me are not following the rules of social distance, hygiene and staying at home when they don’t have to go out.
So I have no choice. I’ll just have to get through it again. “Again”, because I already had it once before, in April this year.