How to repair the GRUB bootloader using a Ubuntu Live USB drive

If you have an Ubuntu Live CD or USB drive lying around, you can use it to reset bootloader so that Grub can retake the boot screen.

Ubuntu Live CD or a USB drive comes in handy at times when something goes wrong. You can do things like recovering data, check for hard disk errors, or even restore the Grub bootloader.

It’s easier to mess up the Grub when you have changed the configuration of your computer. For instance, Grub can become inaccessible after you installed Windows in a dual boot configuration with a Linux distro because Windows Boot Manager takes over the bootloader and it doesn’t recognize Linux. If you have an Ubuntu Live CD or USB drive lying around, you can use it to reset bootloader so that Grub can retake the boot screen.

If you haven’t created an Ubuntu Live USB drive yet, check out our guide “Creating Ubuntu Live USB drive” and come back and follow the steps:

Resetting Grub Bootloader using a Ubuntu Live USB drive

This is a command-line way of restoring the grub. If “Terminal” is not your cup of tea, I suggest you check the graphical user interface way by using Grub Repair.

Step 1. Insert your Ubuntu Live USB or CD, then power on your machine.

Step 2. From the Install window, choose the “Try Ubuntu” option to open an Ubuntu live session.

Try Ubuntu
Try Ubuntu

Step 3. Open a new terminal window from the left panel or simply you can use the next shortcut from your keyboard CTRL+ALT+T.

Step 4. First, we need to know which partition is Ubuntu installed. You can know where Ubuntu is installed by using the “fdisk” or the “blkid” command.

Using the “fdisk” command:

fdisk -l

After executing the previous command, you will get an output like the below screenshot. As you can see Ubuntu is installed on the “/dev/sda1” partition.

Determine the Partition on Which Ubuntu is Installed Using fdisk
Determine the Partition on Which Ubuntu is Installed Using fdisk

Also, you can check where Ubuntu is installed using the “blkid”. The “blkid” command can provide you with more information about the partitions especially if they are labeled.

sudo blkid

After executing the previous command, it will list all partitions. Just search for the partition with type “ext4”. As you can see in our case Ubuntu is installed on the “/dev/sda1” partition.

Determine the Partition on Which Ubuntu is Installed Using blkid
Determine the Partition on Which Ubuntu is Installed Using blkid

Step 5. Next, we need to mount the partition where Ubuntu is installed to the “/mnt” mount point.

sudo mount /dev/sda1 /mnt

Mount The Partition with Ubuntu Installed On It
Mount The Partition with Ubuntu Installed On It

As shown in the above screenshot the “/dev/sda1” is mounted successfully.

Step 6. Now we will use the “grub-install” command to restore all the missing files into the grub folder.

sudo grub-install --boot-directory=/mnt/boot /dev/sda

Restore Missing Grub Files Using the Grub Install Command
Restore Missing Grub Files Using the Grub Install Command

Finally, you can now reboot your Ubuntu and the Grub boot menu should now appear.

Congratulations you have just restored the Ubuntu Grub boot menu.

Hend Adel
Hi! I'm Hend Adel, a freelancer technical geek with successful experience in Database, Linux and many other IT fields. I help to build solutions to suit business needs and creating streamlined processes. I love Linux and I'm here to share my skills via FOSS Linux! Thanks for reading my article.

5 COMMENTS

  1. I have installed Peach OSI: The Patriot on a 64 GB USB 3.0 pendrive and have customized many things according to my choices and also have many data on it. I used EaseUS Partition tool in Windows 7 and cloned full pendrive with .ext4 partition onto a microSD card, but it failed to boot. I tried Boot-Repair tool with net connection, then also booting was not successful. I tried to run Live CD of Peach OSI and tried to install grub from command line, but it showed some error like failed to get canonical path of ‘/cow’ I am really surprised to know there is only either Boot Repair or command line option to repair a non-booting Linux OS!!!

LEAVE A REPLY

Please enter your comment!
Please enter your name here

STAY CONNECTED

23,241FansLike
391FollowersFollow
16SubscribersSubscribe

LATEST ARTICLES

MUST READ

The Ubuntu Cinnamon Remix brings together Linux Mint's Cinnamon desktop with the Ubuntu Core. While some users are welcoming the new flavor of Ubuntu with open arms, others are scratching their heads, wondering where it fits in.
The wait is finally over (almost) for all you Ubuntu fans out there. The latest version of Ubuntu, 20.10 codenamed "Groovy Gorilla," is currently available in the beta version. I have tested out the distro myself, and it is stable enough to take out for a spin.

10 Reasons to use Cinnamon as your Desktop Environment

With the release of Gnome 3 in 2011, there was quite a mixed reaction from users and developers. Most of them preferred the original Gnome that got forked, and one of those forks was Cinnamon. Since the release of Cinnamon 2.0, Cinnamon has evolved to become a desktop environment by itself.

Top 10 Laptops that Ship with Linux Pre-installed [2020 Edition]

If macOS or Windows-based systems no longer intrigue you, laptops that come with Linux pre-installed are definitely something to check out before deciding. While the Linux OS may have a bit of notoriety for being technical and complicated, tons of Linux distributions are perfect for beginners and will make the transition much easier.

5 Best Music Players for Linux

For sure, there will be Linux users out there who cannot live without music. If you're one of those people, you would know how important it is to have a good music player installed on your computer system. In this article, we present to you the five Best Music Players for Linux, which will hopefully be able to satisfy each of our readers' needs.

5 Best Download Managers for Linux

We often need to download large files that can go corrupt due to various reasons such as slow internet or interrupted download. Using a broken downloaded file is not something one wants. Download managers make sure that the downloaded file maintains its integrity and also presents you with the ability to pause and resume downloads, provided the server supports it. When you are downloading a massive file, it's recommended to use a download manager.