top of page

How to improve BOOT speed of your LINUX system.

Well Linux as an OS is already quite fast, but still if you are observing some slowness in boot speed during start-up of your machine and want to improve the Linux boot speed then thanks to the GRUB Boot Loader from where you can modify the default start-up setting (its acritical process, follow all steps carefully) with a GRUB Tweak.

Check out my VideoPost for "How to improve BOOT speed of your LINUX system."

So, in this Blogpost you’ll see and learn how to improve your Linux system boot time a lot faster by modifying grubs. You need to follow below steps very carefully:

Backup/Copy Grub config file.

Making changes to the Grub config file, however small, is dangerous. Any wrong changes could seriously break your system and potentially mess it up. So, before applying any changes to grub config file to speed up your boot time on Linux, it is critical that you go over how to make a backup of your Grub configuration file. To do this:

  1. Launch a terminal window by pressing Ctrl+Alt+T or Ctrl+Shift+T on the keyboard.

  2. Logon to the Root shell by executing below command/s: su – Or, sudo su – Or, sudo -s

  3. Once you’ve got access to a Root shell, Goto below path and find grub config file. cd /etc/default ls -l

  4. Once you’ve found grub file, use the CP command to make a complete backup or copy of the Grub bootloader config file. cp grub grub.bak Or, cp /etc/default/grub /etc/default/grub/grub.bak

  5. Once copy command executed, check backup file of grub (ilke grub.bak in my case). cd /etc/default ls -l

Modify Boot Time in Grub

The Grub bootloader has a setting called “GRUB_TIMEOUT.” This setting is how long your computer will sit and idle before choosing to load up the default operating system. By default, it’s set to 5 to 10 seconds, and for most people, that’s enough time to wait. However, if you’re looking to speed up your boot time, changing this number is the most effective way to do it.

To change the boot speed in the Grub bootloader, you’ll need to edit the configuration file using the gedit and Nano text editor. To start the editing process, execute below commands:


  1. Launch a terminal window by pressing Ctrl+Alt+T or Ctrl+Shift+T on the keyboard.

  2. Logon to the Root shell by executing below command/s: su – Or, sudo su – Or, sudo -s

  3. Once you’ve got access to a Root shell, Goto below path and find grub config file. cd /etc/default ls -l

  4. Once you’ve found the Grub bootloader config file, open this file by typing this command: gedit /etc/default/grub Or, nano -w grub

  5. See grub config file is now opened and the only real thing that you need to change here is the GRUB_TIMEOUT. Look through the text file for the “GRUB_TIMEOUT” entry. Then, erase the number mentioned (like 10 in my case) and change it to a smaller number. Keep in mind that the lower this number is, the faster your PC will boot. For the absolute fastest results, change it to: GRUB_TIMEOUT=0 (Not Recommended) Alternatively, if you’re interested in speeding up Grub, but still want to be able to read the menu, set it to 2 seconds. GRUB_TIMEOUT=2 (Recommended) Once You’ve made changes to GRUB_TIMEOUT value, save the grub config file:


gedit : Press Ctrl+S or Click on SAVE button and Close(X) the file or press Ctrl+X.

Nano : Press Ctrl+O on the keyboard. Then, close the Nano text editor out by pressing Ctrl+X.


Apply the Grub Config changes.


Now, it’s time to apply the changes made in the grub Bootloader config file and the only way to implement configuration changes to Grub is to update the Bootloader. To do that, you’ll need to use your Linux distribution’s bootloader updating mechanism.


  1. Launch a terminal window by pressing Ctrl+Alt+T or Ctrl+Shift+T on the keyboard.

  2. Logon to the Root shell by executing below command/s: su – Or, sudo su – Or, sudo -s

  3. Now that the terminal shell has root access follow the instructions to update the Grub bootloader that match the Linux distribution you use. sudo update-grub (Ubuntu/Debian) sudo grub2-mkconfig -o /boot/grub2/grub.cfg (Fedora/OpenSUSE) sudo grub-mkconfig -o /boot/grub/grub.cfg (Arch Linux) When the update Grub command executed successfully, the applied changes should be in effect!

  4. Now take the reboot of your Linux machine and you will see the grub setup logs on startup boot is just right away skipped. Well, it can be different depending on the Operating system you are using and also boot speed depends on the kind of storage you are using, like it could be much faster in case of SSD.


Undo changes to Grub

If you have decided to rollback or undo the changes made to Grub, you’ll need to restore the backup of grub config file made earlier. Follow below steps to rollback the changes made:


  1. Launch a terminal window by pressing Ctrl+Alt+T or Ctrl+Shift+T on the keyboard.

  2. Logon to the Root shell by executing below command/s: su – Or, sudo su – Or, sudo -s

  3. Once you’ve got access to a Root shell, Goto below path and find grub config file. cd /etc/default ls -l

  4. Once you’ve found the existing grub config file, delete this file on your Linux system using the RM command. rm grub Or, rm /etc/default/grub

  5. After removing the existing Grub configuration file from the system, it’s time to copy or restore the backup of grub (like grub.bak in my case) which was taken earlier using the MV command. mv grub.bak grub Or, mv /etc/default/grub.bak /etc/default/grub

  6. Once restoration of grub backup finishes, update the Grub to finalize the changes made and take the reboot of your system. sudo update-grub (Ubuntu/Debian) sudo grub2-mkconfig -o /boot/grub2/grub.cfg (Fedora/OpenSUSE) sudo grub-mkconfig -o /boot/grub/grub.cfg (Arch Linux)


That's all in this post. If you liked this blog and interested in knowing more about UNIX / LINUX / AIX. Please Like, Follow, Share & Subscribe to www.ImJhaChandan.com

Kommentare


jc_logo.png

Hi, thanks for stopping by!

Welcome! to my “Muse & Learn” blog.

This website will help you to learn useful queries/SQL, Tips to troubleshoot problem and their remediation, perform DB related activities etc... and don't forget to muse with us :)....

It cover few useful information on below topics :

 

MySQL, SQL Server, DB2, Linux/UNIX/AIX, HTML ....

Let the posts
come to you.

Thanks for submitting!

  • Instagram
  • Facebook
  • Twitter
© 2023 By ImJhaChandan
bottom of page