16.04 - Is it possible to speed up kernel boot time?

5,178

You can trim down the initramfs to speed up boot by editing /etc/initramfs-tools/initramfs.conf and setting MODULES=dep.

Then run the following to update the initramfs to hopefully make a smaller one:

sudo update-initramfs -u

Share:
5,178

Related videos on Youtube

glen abdelnoor
Author by

glen abdelnoor

Saved former Windows user, Ubuntu saved my dying computer, never looked back!

Updated on September 18, 2022

Comments

  • glen abdelnoor
    glen abdelnoor over 1 year

    I am working on trying to get my boot up time as short as possible. I have done several changes that got my time from 3 minutes down to about 14 seconds. All of the changes seem to affect the userspace startup portion. The one thing that I noticed remains constant is the kernel startup speed. systemd-analyze gives me the following results:

    Startup finished in 11.162s (kernel) + 3.239s (userspace) = 14.402s
    

    I have tried setting GRUB_TIMEOUT=1 in /etc/default/grub but that did not influence the startup time for the kernel.

    I am running 16.04 on a Lenovo U510 with a 1TB hybrid drive, no other OS on board. Thanks!

    • j0h
      j0h about 7 years
      Some linux distros are better for this. Gentoo for example. Load fewer modules on boot, and boot time should decrease. grub doesn't have much to do with the kernel. perhaps migrate this to Unix & linux SE
    • Panther
      Panther about 7 years
      The only way is to build your own kernel . The benefits will be modest at best.
    • Fabby
      Fabby about 7 years
      14 seconds is great! Congrats! Don't change anything!
    • glen abdelnoor
      glen abdelnoor about 7 years
      Thanks, always looking to improve though, kind of the Millennium Falcon approach; keep tweaking it until I break/learn something.
  • glen abdelnoor
    glen abdelnoor about 7 years
    That seemed to work! My new startup numbers are Startup finished in 10.685s (kernel) + 2.321s (userspace) = 13.006s When I did the update I had to add "-u" to the end for it to work, so sudo update-initramfs -u , do you know why that is?
  • Colin Ian King
    Colin Ian King about 7 years
    Sorry, my instructions were wrong, you do need a -u to trigger the update. I'll update the instructions. My bad.