Ever turn on your Linux PC only to find that it won’t load and you don’t know what to do? When your PC won’t turn, troubleshooting it becomes complicated. To begin with, there’s nothing you can do to run checks on your OS or your hardware. The little you can do is make sure you’ve plugged everything in correctly. That said, just because your PC won’t boot doesn’t mean it’s dead or you need to refresh your OS. Don’t re-install that operating system on your Linux PC just yet though. Instead, follow this tutorial to fix a Linux PC that won’t boot.
You will need a working PC to follow this tutorial because it involves downloading disk images and burning them to a USB.
Rescuing Grub With Super Grub Disk
The easiest way to load a Linux PC with a broken bootloader isn’t to fuss with the Grub rescue prompt. Instead, go to another computer (or make this disk ahead of time) and download Super Grub Disk. It is a live disk that can detect all operating systems on any given computer, then boot them. This tool is great, especially for those that suddenly find their PC won’t load Grub correctly.
First, download the disk image. Then, burn Super Grub Disk to a CD/DVD or make a bootable USB flash drive. We recommend the Etcher USB imaging tool as it is easy to use and available on all major platforms.
With Super Grub Disk burned, it’s time to load it and use it. Start off by entering your PC’s BIOS settings. In this area, change the boot order so that the live USB stick (or burned CD/DVD) will load first.
When Super Grub Disk loads it displays a menu. The only option on the menu that matters here is the “detect and show boot methods” one. Select it with the enter key on the keyboard. The live disk will find each and every possible operating system that it can load.
The Super Grub Disk prints out a list of different operating systems. Using the arrow key, select the operating system that wouldn’t load previously.
Note: Super Grub Disk can usually load a broken Linux distribution because it finds files like the boot image, instead of Grub configuration files. In rare cases, even this tool will not be able to load broken operating systems. If this is the case, consider re-installing, or trying out some of the other options inside of the live disk.
With the help of Super Grub Disk, you’ve loaded the Linux installation again, despite the fact that Grub is broken. Now it’s the time to re-install Grub so that everything can go back to normal.
BIOS/MBR style partition layout
Re-install the Grub to the hard drive’s master boot record.
sudo grub-install --recheck --target=i386-pc /dev/sda
Then, regenerate a new configuration file. This is necessary, otherwise the bootloader might not know that changes have been made.
sudo grub-mkconfig -o /boot/grub/grub.cfg
GPT/EFI style partition layout
grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=grub sudo grub-mkconfig -o /boot/grub/grub.cfg
How to install Grub to a USB drive for emergency recovery
Grub doesn’t break often, but when it does, your whole day is ruined. This is why it’s always good to have a recovery process in place in case this happens. For most people, using Super Grub Disk is a good option. However, there is also an alternative.
Since Linux is so versatile, it is actually possible to install the Grub bootloader directly to a flash drive. This way, if your Linux installation refuses to boot with the bootloader installed on the hard drive, you can plug in a USB drive and load it anyway. Here are the steps to setting this up.
Note: flash drive MUST be formatted as Fat32!
First, make a USB folder in /mnt.
mkdir -p /mnt/usb
Next, use the
lsblk command to find out what the USB drive is labeled. In this tutorial, we’ll call the flash drive /dev/sdc. You can name it differently if you want.
Mount the USB disk to the USB folder in /mnt created earlier.
mount /dev/sdc1 /mnt/usb
Then, perform the Grub installation on the USB flash drive.
grub-install --target=i386-pc --debug --boot-directory=/mnt/usb/boot /dev/sdc Lastly, generate a configuration file for the USB drive.
grub-mkconfig -o /mnt/usb/boot/grub/grub.cfg
None of the options listed above working for you? Don’t worry! There’s more ways to recover a broken Grub installation on Linux. Consider using Rescatux. Like Super Grub Disk, it’s a live Grub bootloader rescue disk. Except instead of automatically detecting boot-methods and allowing the user to boot, it can actually fix Grub/Grub2 issues automatically.
This is perfect for those who have followed this tutorial, and have found that re-installing Grub via the command line didn’t help. Download the disk, and follow the directions (for Super Grub Disk) mentioned above to make a live disk.
Additionally, learn how to boot manually with the Grub command line if all else fails, by reading the GNU grub manual. It’s a complicated and difficult process that isn’t worth talking about as Super Grub Disk does the same, but if all options have failed and this is the only option, do read it, as it will help.
Grub has existed for quite a long time, but for as long as it has existed, it has caused countless problems. Sometimes Grub fails to boot out of nowhere, sometimes it a configuration file breaks, and sometimes it refuses to load altogether. Hopefully, the tips and tricks in this article will fix a Linux PC that won’t boot in most cases.