Select Page

If you have seen this error, you were probably installing a GNU/Linux variant (eg. Ubuntu) when the installation process was suddenly interrupted. I know how frustrating it could be when you’re trying to install an operating system and suddenly you have hard disk problems. Today, I’m going to walk you through the process of troubleshooting and fixing this annoying error.

Introduction to grub-install

grub-install‘ copies a GRUB image by using ‘grub-mkimage' then it installs it to the MBR of a hard drive.  You must include the drive on which you want to install GRUB. It goes like this:

grub-install /dev/sdx

x refers to the device name. Now that you have a basic idea of what grub-install does, let’s start the troubleshooting process with one of the most common mistakes that could produce that error.

Explicitly specify the hard drive

As you could see in the error message, the installer is trying to install GRUB on /dev/sda. If you don’t know what /dev/sda is, it is basically a naming convention for your hard drives. Since everything is a file on UNIX-compatible operating systems, hardware is not an exception. Every piece of hardware that exists on the computer has a special file that resides in the /dev directory, including the storage devices.

All storage devices are represented with sd. When we are referring to /dev/sda, we mean storage device A. Now this is important because if you have multiple storage devices, including the USB device, you could potentially be trying to install GRUB on the wrong drive. Your target hard drive could be possible B instead of A, so perhaps you want to install GRUB on /dev/sdb instead of /dev/sda, and that’s what might have caused the error. 

Some installers, like the Ubuntu installer, have an option that’s called automatically install to MBR of first hard drive. That option, as the name suggests, automatically installs GRUB to /dev/sda. So if your target drive is /dev/sdb, you might want to pick No and pick /dev/sdb manually instead. If you are sure that you have picked the right drive, then you could proceed with the troubleshooting process.

Installing on a Lenovo laptop

If you’re installing the operating system on a Lenovo laptop, there are a couple of BIOS options that could cause the problem. That includes Fast Boot and Secure Boot. Fast Boot is a feature in BIOS that limits boot time drastically by disabling boot from some Devices. Sometimes when you are dual booting, this feature will hinder your installation, and might trigger this error.

Secure Boot is security feature that is designed to stop harmful code from being loaded when your PC boots. Almost all computers could boot in Secure Boot mode, but in some cases, there might be options that could cause your PC to be incapable of Secure Boot. These options can be altered in the BIOS. It may cause some issues when you are installing, including that error.

Now it’s better to disable both Fast Boot and Secure Boot if you are trying to install the operating system. If that still did not work, then continue reading the article.

Check partition type

Another possible cause of this issue is the type of the partition you are trying to use for installation. If you are trying to install on Logical partitions, try changing the type to Primary. This usually occurs if you tried creating partitions manually. If that did not work, then let’s proceed.

Try running boot-repair

If you are trying to install Ubuntu, you might want to try Boot-Repair, which is a simple program that fixes common boot problems that you might have when you’re trying to install Ubuntu. For example, if you couldn’t boot Ubuntu after installing Windows or another GNU/Linux distro. Another example is when you cannot boot Windows after installing Ubuntu. Or when you cannot find GRUB anymore. Some upgrades might break GRUB.

Boot-Repair lets you get rid of these problems with a simple click, which basically reinstalls GRUB and restores your access to the operating systems that you had installed before the issue. This tool might simply fix the error you are facing. To use Boot-Repair, you simply boot into a live environment and run the following commands in the terminal:

sudo apt-add-repository ppa:yannubuntu/boot-repair
sudo apt-get update
sudo apt-get install boot-repair
boot-repair

Then, when it launches, check all the options in Advanced Options > Main Options and click Apply.

If you cannot use Boot-Repair for some reason, then you could try to manually install GRUB in our final method.

Reinstall GRUB

From your live environment, or from your installation software terminal, try reinstalling GRUB with the following commands:

grub-install /dev/sdx
update-grub

Replace the x in sdx with your actual drive. If your drive is b, then use /dev/sdb instead.

Conclusion

GNU/Linux comes with its challenges and issues from the beginning. If you are facing installation issues as a beginner, just keep calm and try debugging it step-by-step. If you cannot debug the issue yourself, try asking a professional for help. Remember to always backup your important data before attempting to do anything.