Troubleshoot Linux boot problems with GRUB

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 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 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 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

May be interested

  • How to access the Boot menu in Windows 11How to access the Boot menu in Windows 11
    the advanced options menu, sometimes called the boot menu, is a collection of tools and configuration options that you can use to troubleshoot or repair problems related to software on your windows pc.
  • 5 measures to increase Linux boot speed5 measures to increase Linux boot speed
    linux users can be proud that the speed of operating on linux is quite fast when compared to other operating systems. not only that, linux does not seem to suffer the bogging down effect that windows has always encountered when users install hundreds of applications on the system.
  • Troubleshoot computer problems that do not startTroubleshoot computer problems that do not start
    why don't we try to find out if there is any way we can fix the problem without losing all the data in the installation drive?
  • How to troubleshoot Windows with Event Viewer logHow to troubleshoot Windows with Event Viewer log
    there are several ways to view log files in windows, so you can diagnose problems like crashes, freezes, and improper functioning. the following article will explain best methods to find the solution you need.
  • How to implement Clean Boot on Windows 10/8/7How to implement Clean Boot on Windows 10/8/7
    clean boot state is used to diagnose and fix problems on windows. if your computer cannot start normally or if during the boot process you receive an error message, then you might consider performing a clean boot.
  • How to create USB Boot Live Kali LinuxHow to create USB Boot Live Kali Linux
    the most popular and fastest way to apply kali linux is to run it from a usb drive. this method has many advantages. to do this, we first need to create a bootable usb drive from an iso image of kali linux.
  • 4 common GPU problems and how to fix them4 common GPU problems and how to fix them
    the gpu can have problems at some point. that's what electronic devices often have to deal with, because they have a finite lifespan. you'll need to learn how to troubleshoot problems in your gpu.
  • Windows 8 security feature prevents dual booting with LinuxWindows 8 security feature prevents dual booting with Linux
    many recent reports show that microsoft's new secure boot function in windows 8 could prevent some users from running both windows and linux on their computers.
  • How to create a Live CD Linux discHow to create a Live CD Linux disc
    a live cd is a bootable cd, dvd or usb drive with an operating system ready to run when the disc is inserted into the computer. this article will show you how to create a linux live cd.
  • How to run Linux commands when starting Windows Subsystem for Linux on Windows 10How to run Linux commands when starting Windows Subsystem for Linux on Windows 10
    the latest beta version of windows 10 allows users to automatically run linux commands when windows subsystem for linux starts.