How to Speed Up Your Linux Boot Time
The time a system takes from pressing the power button until it is completely loaded and is ready to use is referred to as the boot time. Speeding up your Linux boot time ensures a better user experience and quick access to the critical features. The boot time depends on several factors, such as disk usage, startup services, boot loader, etc. You can optimize these factors to improve the Linux boot time.
In this guide, we’ll show you how to speed up the Linux boot time by optimizing different system resources.
Analyze the Current Boot Time
Analyzing the current boot time helps you identify the bottlenecks before optimizing your Linux system. To do this, you can use the systemd-analyze command:
systemd-analyze The output snippet highlights that the kernel is taking almost 6 seconds to boot, while userspace requires 56.651 seconds:
Disable Services and Daemons to Speed Up Linux Boot Time
To speed up your Linux boot time, you can find the services that are causing the timeout and disable them using the “systemctl disable” command.
The unit files contain all the information related to the services. Use the command below to check the current status of the services:
systemctl list-unit-files –type=service This command will help you identify which service should be disabled:
Alternatively, you can use the systemd-analyze command with the “blame” subcommand to get a detailed list of running services, showing the boot time of each service:
systemd-analyze blame Press Enter to read more services stats and q to return to the terminal:
Once you have identified the services and daemons that are taking too much time to load, you can disable them to speed up the boot time:
sudo systemctl disable serviceName.service Replace the serviceName with the service you want to disable. For example, I use MySQL occasionally, so I don’t need it on every boot. Therefore, I can execute the command below to disable it and improve the boot time:
sudo systemctl disable mysql.service This command ensures that the MySQL service doesn’t run on every boot:
Similarly, you can disable all the services that you don’t need anymore to optimize the boot time.
Optimize Disk Usage to Enhance Boot Time
An optimal disk usage ensures a smooth boot. If your disk usage is not optimized, you can use a disk cleaner like BleachBit or Stacer to clean up your disk, which ultimately enhances Linux boot time. However, to use any of these tools, you need to install them. You can do so by using your default distribution package manager:
sudo apt install bleachbit
sudo apt install stacer Another way to keep your system optimized is by switching to a lightweight desktop, such as Xfce or Xubuntu. You can install these desktops on your Linux machine using the distribution’s default package manager:
sudo apt-get install xfce4
sudo apt install xubuntu-desktop You can switch to one of these Desktops and analyze if the boot speed has improved or not.
Optimize Kernel with Kernel Update Utility
Optimizing the kernel implies minimizing the Linux boot time. You can reduce the kernel size, unnecessary driver load, and simplify the initialization process to optimize your kernel.
You can update the kernel using the Ubuntu Kernel Update Utility (UKUU), which can be installed using the following command:
sudo apt install ukuu Moreover, you can tune the kernel parameters in the “/etc/sysctl.conf” file to reduce the boot timeout. For example, the vm.swappiness is a kernel parameter that is used to balance the data in RAM. We can specify a lower value for the vm.swappiness parameter to optimize the boot time:
echo “vm.swappiness=8” | sudo tee -a /etc/sysctl.conf Enable Fast Boot
Enabling fast boot reduces the hardware initialization time. This can be done by entering into the UEFI or BIOS settings using keys like F2, F12, Esc, or Del during the startup. In the BIOS/UEFI settings, look for fast boot or quick startup options, and enable them. This reduces the hardware initialization times and consequently enhances the boot time.
Moreover, you can edit the GRUB configuration to disable the unnecessary boot messages and splash screens. To do this, access the grub config file in an editor, like Nano or Vim:
sudo nano /etc/default/grub Now, remove the line that sets the default boot to quiet splash:
GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash”
After editing the GRUB configuration file, update the GRUB using the following command:
sudo update-grub
This will enable fast boot and improve the overall Linux boot time.
Update Your System Regularly
One of the most common reasons that causes a Linux system to take too much time to boot is that we don’t update our systems regularly. An updated system ensures bug fixes and better performance. Therefore, it’s recommended to keep your system updated to avoid issues like delayed boot times. This can be done using your distribution’s package manager, like apt for Ubuntu/Debian, dnf for Fedora, and so on:
sudo apt update && sudo apt upgrade
Use a Different Boot Loader
Switching to a different boot loader can also improve the Linux boot time. For example, GRUB is the default boot loader in Ubuntu; we can try a different one like rEFInd to speed up the boot process. For that, we have to install that particular boot loader on our machine:
sudo apt install refind Once installed, you need to configure it by editing the rEFInd configuration file:
sudo nano /boot/efi/EFI/refind/refind.conf Now, you can update the hideui and timeout options in the configuration file to enhance the overall boot time.
Final Thoughts
Speeding up a Linux boot time ensures quick access to critical features, enhances user experience, and reduces timeouts and delays. You can do this by disabling unnecessary startup services and daemons, optimizing disk usage and kernel parameters, enabling fast boot, updating your system regularly, or using a different boot loader. In this article, we discussed all these methods with step-by-step instructions to help you optimize your Linux boot time.



