Shorter boot time

The boot time I have from starting the computer until I can login was quite long. With this guide you can shorten your UEFI BIOS time. The rest of the guide is for Ubuntu 21.10 or later to speed up boot time.

Memory

See the amount of free memory

free --mega -w

See the brand of your memory modules

sudo lshw -c memory

System start time

systemd-analyze

I got 2021-10-24

Startup finished in 31.343s (firmware) + 3.445s (loader) + 17.818s (kernel) + 16.617s (userspace) = 1min 9.225s 
graphical.target reached after 16.555s in userspace

After doing fixes in this document i got

Startup finished in 10.856s (firmware) + 3.440s (loader) + 17.438s (kernel) + 10.113s (userspace) = 41.848s 
graphical.target reached after 10.050s in userspace

The interested part for the user is the graphical.target reached after 16.555s in userspace since that is when you reach the desktop.

You can see in detail what took so long.

systemd-analyze blame

And you notice the two first rows take a lot of time.

11.341s NetworkManager-wait-online.service
 4.254s plymouth-quit-wait.service

The NetworkManager-wait-online.service wait for a network connection to be established so that other startup programs that might need network will have that available.
This does not slow down your boot. Most user just want to get to the desktop.

Benchmark

You can use hardinfo to get system information and do benchmarks.

sudo apt-get install hardinfo

Start it as a normal desktop program.

I got these results

Computer

Processor : AMD Ryzen 7 1700 Eight-Core Processor
Memory : 16316MB (4409MB used)
Machine Type : Desktop
Operating System : Ubuntu 21.10
Date/Time : sön 24 okt 2021 07:03:14

Benchmarks

CPU Blowfish 0,89
CPU CryptoHash 1363,69
CPU Fibonacci 0,41
CPU N-Queens 5,55
CPU Zlib 2,47
FPU FFT 0,94
FPU Raytracing 4,22
GPU Drawing 12802,23

Snap

On Ubuntu it is now common to install programs as snaps. Snap isolate the programs from each other and you can set rights what a program is allowed to do.

List all your installed snaps

snap list

During boot the snaps are mounted. Remove the ones you do not use. See below.

Find a program to install

snap find nextcloud

Install a snap

snap install nextcloud

Uninstall a snap

snap remove nextcloud

See more details here.

List all your installed snaps including disabled old revisions.

snap list --all

You can set a limit how many revisions you want to keep.

sudo snap set system refresh.retain=2

You can delete all old revisions, see here.
That will save you disk space.

Uninstalling snaps I did not use and remove old revisions made the boot for userspace 6 seconds faster.

UEFI BIOS

The big part of the loading time was firmware. I entered the UEFI bios by repeatedly pressing the Delete button during boot.

I have a desktop computer and listen to music through the HDMI audio plug on the screen.
Disabled WiFi, Bluetooth, Audio. Also disabled USB Legacy compability.

My RAM modules were clocked at 2166MHz but can handle 3000MHz.
Followed the tip that close enough ram modules.
Only changed DRAM speed to manual 3000MHz and DRAM voltage to 1.35v.

These changes made the firmware load 20 seconds faster.

Disk encryption

I have full disk encryption enabled. It takes a while to get the password prompt.
If you have a laptop then you need disk encryption just in case your computer get lost.
On a stationary computer at home where you have standard programs and have everything private in Vera-encrypt-files, then it is a less obvious choice.

You can not unencrypt a hard disk in any easy way. The most straight forward way is to reinstall Ubuntu and reformat the hard drive without encryption.

EndOfDocument