How to decrease / improve boot time of a 17.04 Ubuntu fresh install if it takes longer than 3 min Prabath Swarna Follow May 24, 2017 · 2 min read

Did you encrypt your home folder when installing 17.04? Or if you had an encrypted home when you upgraded, you might have this problem of Ubuntu taking more than few minutes to boot.

This happens because the Ubuntu live installer — Ubiquity has this bug that makes it confused about swap partitions and swap files, which makes it spend unnecessary amount of time at boot trying to look for a swap partition.

To check how much time was spent at boot you can run systemd-analyse . And you will get an output similar to:

Startup finished in 3.709s (firmware) + 5.687s (loader) + 4.893s (kernel) + 16.275s (userspace) = 30.566s

If this number is abnormally large like 3min there might be a problem.

The fix

Open the file /etc/crypttab . You can do this by typing sudo gedit /etc/crypttab in the terminal. Opening as root because we’re going to need edit it.

See in the file if it says something similar to:

cryptswap1 UID=XXXXXXXX /dev/urandom swap,offset=1024,cipher=aes-xts-plain64

This is if you have a swapfile with UID=XXXXXXXX for a swapfile this should be changed to:

cryptswap1 /swapfile /dev/urandom swap,offset=1024,cipher=aes-xts-plain64

simply change UID=XXXXXXXX in to /swapfile . Save the file and quit.

Then check if the last two lines of /etc/fstab is similar to this:

/swapfile none swap sw 0 0

/dev/mapper/cryptswap1 none swap sw 0 0