Open In App

How to Fix GRUB in Ubuntu?

Last Updated : 29 Apr, 2024
Improve
Improve
Like Article
Like
Save
Share
Report

One of the most important parts of Linux systems, including Ubuntu system software, is the GRUB (Grand Unified Bootloader), which controls the internal boot process. A live Linux distribution can be used to recover the overall Linux operating system if the GRUB bootloader has been corrupted or erased by the system. The GRUB bootloader may occasionally get corrupted or destroyed as a result of system updates, configuration modifications, or other causes, making it unable to boot into Ubuntu.

In this article, we will discuss how to fix grub in Ubuntu by using some simple processes.

How to fix grub in Ubuntu?

We’ll go through the actual process of getting your system to boot successfully by restoring the GRUB bootloader in Ubuntu in this guide. Now, we’ll see the required steps to fix grub in Ubuntu –

Step 1: Boot the system using Live CD/USB

First, we need to boot the internal system using Live CD/USB for better performance.

  • Insert the live Ubuntu CD/USB > Boot the system with it.
  • Select the Boot device from the system’s BIOS or UEFI menu.

Step 2: Open the system Terminal

Next, we need to open the system terminal for further processing.

  • Find out the already installed Linux partition > Use lsblk or fdisk command.
#bash
sudo fdisk -l
  • Look into Linux partition type > Note the required device name.

Step 3: Process the Root Partition system

After that, we need to process or mount the root partition system to follow the proper process.

  • Replace the sda1 with the name of the required device.
#bash
sudo mount /dev/sda1 /mnt

Step 4: Reinstall the GRUB initialization

The process of reinstalling the GRUB depends on the user’s preferences.

  • If users are using BIOS, then follow the below-mentioned command:
#bash
sudo grub-install --boot-directory=/mnt/boot /dev/sda1
  • If users are using UEFI, then follow the below-mentioned command:
#bash
sudo mount /dev/sda1 /mnt/boot/efi sudo grub-install --boot-directory=/mnt/boot --efi-directory=/mnt/boot/efi --removable /dev/sda1

Step 5: Update the GRUB initialization

To add all of your machine’s operating systems to the GRUB menu, follow these steps:

#bash
sudo chroot /mnt update-grub exit

Step 6: Reboot the System

Restart your computer after removing the live CD or USB. You should be able to choose which operating system to boot now that GRUB has displayed the menu.

sudo reboot

Also Read

How to fix the GRUB Bootloader in Ubuntu?

How to Fix Ubuntu Boot Problems?

How to Fix Minimal BASH Like Line Editing is Supported GRUB Error In Linux?

Conclusion

For Linux users, knowing how to restore the GRUB bootloader in Ubuntu is crucial, particularly when problems with booting arise. You may effectively fix GRUB and get back into your Ubuntu system by following the detailed instructions provided above. To prevent unexpected outcomes, always double-check commands and device identifiers. Your Ubuntu installation will start up without a hitch if your GRUB bootloader is working properly, letting you get on with your job uninterrupted.

How to fix grub in Ubuntu – FAQs

How to fix the internal GRUB error in Ubuntu?

Users need to follow the following steps to fix the internal GRUB error in Ubuntu –

  • Boot the Ubuntu using Live CD/USB > Connect the system with internet.
  • Open system terminal > Select Boot repair PPA > Confirm Update.
  • Install the internal Boot repair Sudo apt-get install -y boot-repair && boot-repair > Launch the system and use it properly.

What is the reinstall process of Ubuntu GRUB?

Choose Applications, Accessories, Terminal from the menu bar to open a terminal. Execute the command grub-setup -d as outlined below. By doing this, the GRUB 2 files on the mounted partition will be reinstalled to their correct place and to the device’s MBR.

How to exit GRUB in Ubuntu?

Press the enter key after typing the word “exit” at the Gnu Grub screen.

What do you mean by GRUB Command Line?

The standard bootloader for Linux-based systems, the Grand Unified Bootloader (GRUB) is a utility for loading and booting operating system kernels. Even though GRUB launches first when a computer is turned on, normal users hardly ever see it in use. It runs automatically and doesn’t need input from the user.

What is GRUB in the booting system?

GRUB is a bootloader and boot manager for Linux and other Unix-based operating systems. It is frequently referred to as GNU GRUB or GNU Grand Unified Bootloader. After BIOS completes the required hardware tests and loads it from the Master Boot Record (MBR), GRUB begins to operate. GRUB loads the Linux kernel and then seizes control of the machine.


Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads