I purchased a laptop a few months ago and have become more concerned with boot time since it is not on 24/7 like my desktop was. There are a number of guides around that explain how to speed up the time it takes to boot up in Ubuntu/Linux. Most of them concentrate on disabling unnecessary processes from loading.
I don’t think that those guides are necessarily bad, just that if your boot is really slow, jumping straight into disabling processes isn’t always the most effective first step to take. In general, you may be disabling some processes which
- May not even take much time to load anyway
- May be useful at somepoint in the future when you forget you disabled them
Most importantly, there may be some underlying problem that is causing much more of the slowness. With that said, I think that a better methodology is to check if there are any serious issues first, then concentrate on the details second.
To get a general impression of what was going on at boot time I installed the bootchart package. In Debian based distros, e.g. Ubuntu type:
sudo apt-get install bootchart
This app makes a graph of your boot by representing each process as a bar, the length of each showing the load time.
This is useful because you can actually see what is responsible for large chunks of the boot time. Then you can either decide whether you need the slow loading processes, or whether, shock, the reason for the hang is because of some kind of problem.
Here is my chart before I made any changes.
At 45 seconds, it’s not terribly bad but could definitely be improved. As you can see there is about a 12 second period where cupsd stalls before anything else starts loading.
With that information, I checked out /var/log/cups/error_log which contained one line:
Unable to find IP address for server name "..."
Turns out I had changed the hostname without updating the hosts file. So with that information I updated my /etc/hosts and cut 20 seconds off my boot time!
I think that I could probably shave a few more seconds by disabling certain unnecessary processes and if your boot time is already 30 seconds or less feel free to go for it. But, as a quick first step, it was nice to only spend a few minutes to save a huge chunk of time.