GRUB – How can you improve start-up

Chưa phân loại
Do you know what actually happens when your computer starts and how you can tune it? In this article you will see some basics regarding GRUB and what it does when you boot up. After your hardware is checked with UEFI, your machine will most likely boot into GRUB. This is the most common boot-loader for Linux. On older hardware, you have a BIOS and GRUB supports that also.

What does Grub do?

GRUB is the first thing that runs at boot. It has the responsibility to set from where your system boots, enabling mutli-boot systems. It will also pass a number of parameters to your kernel which depend on the kernel you boot into. Except for making your chosen distribution boot correctly, you can also use a theme for GRUB. That is, if you want to keep even early boot look good.

Where do you store it?

In most cases, your distribution installer will place GRUB “where appropriate”, this is not always ideal. For UEFI systems, which is almost all modern ones, you have many more options to store GRUB. Since this is the boot loader, you first choose a device, most commonly /dev/sda1, then you can choose where modules can be stored. Ordinarily, you would leave all other boot files in the /boot directory but you may need more space so there is an option to move it elsewhere. The safest way to do this is to create a partition that you mount on /boot. Because of the many features of UEFI, you will also store a lot of information in the /boot/efi directory. This will most commonly be a partition that GRUB mounts during boot. In most cases, you will simply run the grub-install script without parameters.

$ grub-install

The grub-install command is a script that looks through your disks and creates menu entries for every OS you have on your disc. This means it will create a chain-loading entry for Windows, if you have it on your disk. The ‘update-grub’ command does similar updates to your existing system. You can also create an ISO file where GRUB resides. You can use this to boot your machine in case you have problems with the current GRUB install.

Some basic settings

To adapt the behaviour of GRUB, you have a few standard settings. Let’s go through them. The GRUBDEFAULT value, usually zero, sets which is your most common entry to boot from. To use it, you set another numerical value or you can name your entry with the ‘id’ tag.

menuentry ‘Ubuntu’ –id ubuntu-linux{

You have the option to set the latest chosen entry as the default. You do this by setting the parameter

You can also set the time it takes before GRUB boots into your default entry. Distributions put ten second for this value, you may want to set it lower when you feel that you will not tweak GRUB anymore.


This entry will set the timeout to 5 seconds.

The really interesting values are for how you boot your Linux system. You will not find the values in GRUB, instead you will need to look for them in the Linux kernel documentation. Some common values are:

Name Meaning
quiet Disable all log messages
splash Shows the splash images
rfkill.defaultstate=0 Make the default rfkill state open

The list is long, you need to look for all of them in the kernel documentation.

Some interesting features

It may seem that all the boot-loader should do is boot the system, but you can have a few special things happen to GRUB.


There are several themes available for GRUB, so you can make the menu look nice. The package is grub2-splashimages in your favourite repository (Ubuntu, at least!). You can find many more themes at Gnome Look, oddly enough!

You may want to protect your machine from intruders by protecting the GRUB install it self. NOTE: If you do not, then someone can reboot your machine and use GRUBs command line to run your OS without password. Achieving root is very easy from GRUB. Having said that, if they have their machine then they can boot from a memory stick and gain access to your files any ways.

To protect GRUB from being changed by anyone who boots your computer, you can set a password. The procedure is simple, just add the password in the GRUB config.file

password_pbkdf2 root grub.pbkdf2.sha512.10000.2CF985259F00B0E51F0226EB24E9A

In the example you need a hashed password, to create it, use the below command

$ grub-mkpasswd-pbkdf2

The command asks you for a password twice and returns the HASH that corresponds to your password.

Where do you find error logs?

Now that you have started changing in GRUB, you will need to check what happened with your changes. So where does GRUB leave its logs? You have two files to examine, as shown below. They contain different details,

/var/boot/log/boot.log This file contains many other data but you can see that the boot succeeded from GRUB.

/var/log/dmesg The ‘dmesg’ file is renewed each day and contains all the kernel parameters that you set during last boot. Very useful to see which values are set by the system.

How do you run it manually?

If you want to try out some settings and commands while it is booting, you can do so. From the GRUB menu, you can go into command line mode and set everything up for the current boot. Nothing will be saved so you will want to take notes while trying this out. The big advantage is that you will not change what GRUB will do on the next boot, so most commands can be cleared with a new reboot.

Tweaking toolkit

You can also consider the ‘grub-customizer’. This is a software package that writes to your GRUB files (/etc/grub.d/40custom). The Grub Customizer With this tool, you can change all values that you wish so be careful. Note that it does not have full documentation for GRUB so must figure out what you want to change from documentation.


When you dig into the documentation of GRUB, you will quickly see that choosing the correct file and partition to boot from is far from the only thing that GRUB does. If you dig deeper, you can make huge changes to your system. You can also render your system un-bootable. So always have backups and an alternative media to boot from.

ONET IDC thành lập vào năm 2012, là công ty chuyên nghiệp tại Việt Nam trong lĩnh vực cung cấp dịch vụ Hosting, VPS, máy chủ vật lý, dịch vụ Firewall Anti DDoS, SSL… Với 10 năm xây dựng và phát triển, ứng dụng nhiều công nghệ hiện đại, ONET IDC đã giúp hàng ngàn khách hàng tin tưởng lựa chọn, mang lại sự ổn định tuyệt đối cho website của khách hàng để thúc đẩy việc kinh doanh đạt được hiệu quả và thành công.
Bài viết liên quan

Best Open Source Web Servers for Linux

Web servers are used to host web sites, and they serve content to end-users when they are being called over the HTTP (Hypertext...

How to install Unity 5.5.1 Stable Release Update on Linux

How to install Unity, a flexible and powerful development platform for creating multiplatform 3D and 2D games as well as...

[iSCSI] Tìm hiểu về iSCSI.

iSCSI là gì ? iSCSI là Internet SCSI (Small Computer System Interface) : là một giao thức cho phép truyền tải...
Bài Viết

Bài Viết Mới Cập Nhật


Mua Proxy v6 US Private chạy PRE, Face, Insta, Gmail

Mua shadowsocks và hướng dẫn sữ dụng trên window

Tại sao Proxy Socks lại được ưa chuộng hơn Proxy HTTP?

Mua thuê proxy v4 nuôi zalo chất lượng cao, kinh nghiệm tránh quét tài khoản zalo