I ran sudo systemd-analyze blame
and noticed that I had a few things which were causing the great majority of boot slow-down.
systemd-udev-settle.service
This is used by LVM (Logical Volume Manager), a sort of software RAID or logic layer that can make several hard-drives pretend to act as if they are one hard drive.
Obviously, if you're running a setup which requires LVM, you cannot disable this, but I'm not... and in fact, this was interfering with ZFS... my L2ARC cache drive on the rpool was designated by its PARTUUID. When I'd reboot to the Zorin OS USB, then boot back into the installed Zorin OS, it would change to the device path and node (ie: /dev/sdf or whatever), then it would fault. This happened several times, each time I would add it back in as a cache drive using the PARTUUID: sudo zpool add rpool cache 112ff53e-6b95-874a-bb76-a2a3d1978ebf
, and each time, it'd change to the device path and node, then fault. Disabling systemd-udev-settle.service fixed that. Further, systemd-udev-settle.service is deprecated and not recommended to be run, so if you don't absolutely need it for LVM, you can disable it:
Check its status:
sudo systemctl status systemd-udev-settle.service
Stop it:
sudo systemctl stop systemd-udev-settle.service
Disable it (it can still be called by other programs and start up):
sudo systemctl disable systemd-udev-settle.service
Mask it so no matter what, it can't start up:
sudo systemctl mask systemd-udev-settle.service
That cut 12 seconds from my boot time.
I did the same for:
Don't run this if you boot your os from a networked drive rather than a SSD/HDD:
sudo systemctl status NetworkManager-wait-online.service
sudo systemctl stop NetworkManager-wait-online.service
sudo systemctl disable NetworkManager-wait-online.service
sudo systemctl mask NetworkManager-wait-online.service
Don't run this if you use dial-up internet:
sudo systemctl status pppd-dns.service
sudo systemctl stop pppd-dns.service
sudo systemctl disable pppd-dns.service
sudo systemctl mask pppd-dns.service
If you don't need or want location awareness / geolocation:
sudo systemctl status geoclue
sudo systemctl stop geoclue
sudo systemctl disable geoclue
sudo systemctl mask geoclue
If you're not so worried about getting the exact right color in a photo or video:
sudo systemctl status colord
sudo systemctl stop colord
sudo systemctl disable colord
sudo systemctl mask colord
If you want to turn off what Windows calls "file indexing" (searching through, cataloging and databasing files to make your file searches faster):
tracker reset --hard
sudo systemctl status tracker-store.service
sudo systemctl stop tracker-store.service
sudo systemctl disable tracker-store.service
sudo systemctl mask tracker-store.service
sudo systemctl status tracker-extract.service
sudo systemctl stop tracker-extract.service
sudo systemctl disable tracker-extract.service
sudo systemctl mask tracker-extract.service
sudo systemctl status org.freedesktop.Tracker1.Miner.Extract
sudo systemctl stop org.freedesktop.Tracker1.Miner.Extract
sudo systemctl disable org.freedesktop.Tracker1.Miner.Extract
sudo systemctl mask org.freedesktop.Tracker1.Miner.Extract
Now I get:
systemd-analyze
Startup finished in 10.474s (kernel) + 21.719s (userspace) = 32.194s
graphical.target reached after 11.524s in userspace
systemd-analyze critical-chain
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 @13.709s
└─udisks2.service @10.402s +3.306s
└─basic.target @10.145s
└─sockets.target @10.144s
└─zsysd.socket @10.142s
└─sysinit.target @10.000s
└─snapd.apparmor.service @9.773s +225ms
└─apparmor.service @8.696s +1.076s
└─local-fs.target @8.695s
└─run-user-1000-gvfs.mount @14.362s
└─run-user-1000.mount @13.225s
└─swap.target @8.154s
└─dev-disk-by\x2duuid-6d1b0ab8\x2d273e\x2d4fe7\x2d93b0\x2d90f74d7154d1.swap @8.146s +5ms
└─dev-disk-by\x2duuid-6d1b0ab8\x2d273e\x2d4fe7\x2d93b0\x2d90f74d7154d1.device @8.145s
In addition, apparently the Tracker service was consuming alot of drive space... before I did the above, I was sitting at 10.34 GB of hard drive space consumed. It is now at 8.07 GB.
You can see all of your services by:
sudo systemctl list-units --type=service --all
sudo systemctl list-unit-files --all
And if you want to unmask and re-enable a service, a good guide is here.