Reinstall GRUB on Linux may seem complex, but this process can be simplified. If your system no longer boots, insert a DVD or USB stick installation of Ubuntu or another Linux distribution. Boot from this media and choose the option to live session. Open a terminal and mount the partition where Linux is installed. You can then use the command grub-install to reinstall GRUB. Make sure to update the configuration file with update-grub for your system to recognize other installations.
The reinstallation of GRUB, the bootloader for many Linux systems, may be necessary in a variety of situations, including corrupted systems or after installing a new operating system. This article will guide you through the simple steps to reinstall GRUB on your Linux machine, whether via Live CD, USB, or with specialized troubleshooting tools.
Environmental preparation
Before you begin the GRUB reinstallation process, you need to make sure you have installation media available. This can be a DVD installation guide for your Linux distribution or a key USB bootable. Insert this media into your computer and boot from it. You will then have to choose the option of live session when the boot menu appears.
Use terminal mode
Once you are in the live environment, open a terminal. You will need to know the name of the partition where your Linux system is installed. This can be done with the command:
This will display a list of partitions, and you should identify which one contains your Linux installation, usually something like this /dev/sda1 or similar.
Mount partition
To proceed with reinstalling GRUB, you must first to go up your system partition. Use the following commands replacing /dev/sda1 by your own partition:
If you have other partitions such as /boot Or /home, it is necessary to also mount them by creating a folder in /mnt.
Reinstall GRUB
Now that your partition is mounted, it’s time to reinstall the GRUB bootloader. Use the following command:
Be sure to indicate the disk (for example, /dev/sda without a partition number) and not a specific partition.
Update GRUB configuration
After installing GRUB, it is crucial to update the configuration file. To do this, run:
This will automatically detect installed operating systems and update the GRUB boot menu accordingly.
Boot from hard drive
Once all steps are completed, you can restart your computer. Make sure to remove the installation media and let the system boot from the hard drive. If all steps were completed correctly, you should see the GRUB boot menu with all the boot options available for your system.