Troubleshoot Linux boot problems with GRUB

GRUB (Grand Unified Bootloader) is a bootloader that allows users to install multiple distributions on the system and select one when the system starts up.
GRUB (Grand Unified Bootloader) is a boot program that allows users to install multiple distributions on the system and select a copy when the system starts up. GRUB is used on Unix-like systems. The GNU operating system and most distributions use GRUB as a bootloader. GRUB provides a bash-style command line interface that is easy to use.

Linux needs GRUB to boot, but you may encounter an error with GRUB preventing the boot process. You can identify the problem because you will then see the following signs appear:
  1. GRUB has been completely deleted and you will see nothing except a blinking cursor when the server starts.
  2. GRUB will generate a specific GRUB error message.
  3. GRUB said it could not find a required file.
If you encounter problems with GRUB, there are two methods you can apply to fix them. You can reinstall GRUB or restart the system manually by entering GRUB in the command line. We will then reinstall GRUB and then download GRUB manually if we encounter a GRUB error.

Reinstall GRUB

If a serious error with the MBR is encountered on the system, it occurs in the case of a cursor blinking at the start of the machine. When an error occurs with the MBR you will not see the GRUB error message. Usually in that situation you will not be able to boot the system, it is best to use the rescue CD to boot the system. You can use Knoppix to boot.

After booting with the rescue disk, go to the chroot environment and use the grub-install command to reinstall GRUB. If you want to install GRUB in the MBR and the hard drive is addressed by the device file / dev / sda , you will have to use the command grub-install / dev / sda . This command will read the GRUB configuration file (located at /boot/grub/menu.lst on most distributions) and based on that to write a new GRUB bootloader to the MBR. Below is the information displayed when using grub-install to reinstall GRUB.
root @ Knoppix: / # grub-install / dev / sda

You should not call / sbin / grub-install. Please call / usr / sbin / grub-install instead!

Tìm kiếm cho GRUB directory installation . tìm thấy: / boot / grub

Installation finished. No error reported.

Đây là nội dung của thiết bị map /boot/grub/device.map.

Hãy kiểm tra nếu này là đúng hoặc không. Nếu bất kỳ các dòng không đúng,

fix it and re-run the script `grub-install '.

(hd0) / dev / sda





Manually start with GRUB

You do not need to reinstall GRUB. If the GRUB code still exists but because of an error in GRUB's configuration file the system cannot boot, then you can try to boot manually. This is the most suitable method if GRUB displays an error message and then stops the boot process. When manually entering all GRUB commands, you can see exactly where the error occurred to help troubleshoot. Follow these steps to manually download the GRUB configuration.

1. To enter the GRUB boot menu you need to check the system behavior carefully at startup. In most cases, it requires you to press the Escape key (ESC) when GRUB is processed. You will then switch to the GRUB command line. Alternatively, you can boot from a rescue CD and enter the GRUB command to open GRUB's command line interface.

Troubleshoot Linux boot problems with GRUB Picture 1Troubleshoot Linux boot problems with GRUB Picture 1

2. GRUBShell provides some support for users so you don't need to remember the commands correctly. To see all GRUB commands you just need to use the help command.

Troubleshoot Linux boot problems with GRUB Picture 2Troubleshoot Linux boot problems with GRUB Picture 2

3. When manual download GRUB requires you to manually enter all commands in the /boot/grub/menu.lst file. It's best to check the current content of the menu.lst file using the cat /boot/grub/menu.lst command. In this file you need to check what system needs to boot.

Troubleshoot Linux boot problems with GRUB Picture 3Troubleshoot Linux boot problems with GRUB Picture 3

4. With the sample lines displayed on the screen, you can manually enter all GRUB lines. That means you must enter the root, kernel, and initrd lines. Eg:
root (hd0,0)

kernel /boot/vmlinuz-2.6.24-16-server root = / dev / sda2 ro splash

initrd /boot/initrd-2.6.24-16-server
5. After entering those commands the system will wait for instructions. Usually, you enter the boot command. After entering the command the startup process will start. You need to pay close attention to detecting errors. If the system does not boot normally, it will also display an error message if you manually enter the lines in the menu.lst file. If that is the case, you need to check the error and restart the system until the boot process is done normally.

GRUB will load in the first boot phase. There may be errors in the MBR, in the GRUB configuration file or in GRUB loaded files. In those cases you can manually enter all GRUB commands to check for errors. If no error is detected, you can choose to reinstall GRUB.
5 ★ | 1 Vote

Maybe you are interested