How to diagnose/fix very slow boot on Ubuntu 18.04

Solution 1:

I upgraded to 18.04 today and encountered the same issue. I was able to fix it by booting the kernel with the noresume parameter.

Like you, I also have no swap space. At some point during the upgrade, the initramfs config was modified, adding a line pointing to a nonexistent swap partition. The slow boot was because it was looking for this partition and then timing out after 30 seconds.

To update GRUB so that it passes this option to the kernel automatically on boot:

  1. Edit the file /etc/default/grub file so that the string noresume is included in the GRUB_CMDLINE_LINUX_DEFAULT line, for example:

    GRUB_CMDLINE_LINUX_DEFAULT="quiet splash noresume"
    
  2. Run this command to update GRUB:

    sudo update-grub
    
  3. Reboot the computer

Solution 2:

$ systemd-analyze blame

Look to see which processes are taking the most time of the boot process.