Menu
There are a lot of methods in Linux that can be used to re-install a broken grub, some can involve the ability to work and restore the boot loader by using the Linux command line and others are fairly simple and implies booting the hardware with a Linux live CD and using the GUI indications to repair the damaged boot loader.
- Restore GRUB bootloader after Windows installation on multi-boot system Windows operating systems have the habit of installing their own bootloader on every installation - this wouldn't be a problem, if they would recognize all present operating systems.
- Today I decided to install Windows 10 Tech Preview on another partition. I guess I was forgetting that this would replace GRUB. The Win10 Boot loader recognizes Windows 7, but not Ubuntu. I know how to replace GRUB with Windows boot loader, but not viceversa. Right now my priority is to bring back GRUB to boot 7 and 14.04, as 10 is not important.
- Jul 03, 2017 Open a Terminal window from the Dash and run the following commands to install and launch Boot Repair: The Boot Repair window will automatically scan your system after you run the boot-repair command. After it scans your system, click the “Recommended repair” button to repair GRUB2.
Ubuntu and many other Linux distributions use the GRUB2 boot loader. If GRUB2 breaks—for example, if you install Windows after installing Ubuntu, or overwrite your MBR—you won’t be able to boot into Ubuntu.
You can easily restore GRUB2 from a Ubuntu live CD or USB drive. This process is different from restoring the legacy GRUB boot loader on older Linux distributions.
This process should work on all versions of Ubuntu. It’s been tested on Ubuntu 16.04 and Ubuntu 14.04.
The Graphical Method: Boot Repair
RELATED:How to Boot Your Computer From a Disc or USB Drive
Boot Repair is a graphical tool that can repair GRUB2 with a single click. This is the ideal solution to boot problems for most users.
If you have the media you installed Ubuntu from, insert it into your computer, restart, and boot from the removable drive. If you don’t, download a Ubuntu live CD and burn it to a disc or create a bootable USB flash drive.
When Ubuntu boots, click “Try Ubuntu” to get a usable desktop environment.
Ensure you have an Internet connection before continuing. You may need to choose a Wi-Fi network and enter its passphrase.
Open a Terminal window from the Dash and run the following commands to install and launch Boot Repair:
The Boot Repair window will automatically scan your system after you run the
boot-repair
command. After it scans your system, click the “Recommended repair” button to repair GRUB2 with a single click.You can choose to use the advanced options here, but Ubuntu’s wiki recommends you not use the advanced options unless you know what you’re doing. The recommended repair option can fix most problems automatically, and you could mess up your system even more by selecting the wrong advanced options.
Boot Repair will begin working. It may ask you to open a Terminal and copy/paste a few commands into it.
Just follow the instructions that appear on your screen. Perform the instructions Boot Repair wants you to and click “Forward” to continue through the wizard. The tool will walk you through everything you need to do.
Restart your computer after the Boot Repair tool finishes applying its changes. Ubuntu should boot up normally.
The Terminal Method
If you’d rather get your hands dirty, you can do this yourself from a terminal. You’ll need to boot from a live CD or USB drive, as in the graphical method above. Ensure the version of Ubuntu on the CD is the same as the version of Ubuntu installed on your computer. For example, if you have Ubuntu 14.04 installed, ensure you use a Ubuntu 14.04 live CD.
Open a terminal after booting into the live environment. Identify the partition Ubuntu is installed on using one of the following commands:
Repair Grub After Windows 10 Install
Here’s the output of both commands. In the
fdisk -l
command, the Ubuntu partition is identified by the word Linux
in the System column. In the blkid
command, the partition is identified by its ext4
file system.If you have multiple Linux ext4 partitions, you can get an idea of which is which by viewing the size of the partitions and their order on the disk here.
Run the following commands to mount the Ubuntu partition at /mnt/ubuntu, replacing
/dev/sdX#
with the device name of your Ubuntu partition from the above commands:In the screenshot above, our Ubuntu partition is /dev/sda1. This means the first partition on the first hard disk device.
Important: If you have a separate boot partition, skip the above command and mount the boot partition at /mnt/ubuntu/boot instead. If you don’t know whether you have a separate boot partition, you probably don’t.
![After After](/uploads/1/2/6/0/126059631/591223471.png)
Run the following command to reinstall grub from the live CD, replacing /dev/sdX with the device name of the hard disk above. Omit the number. For example, if you used
/dev/sda1
above, use /dev/sda
here.Restart your computer and Ubuntu should boot properly.
For more detailed technical information, including how to use the chroot command to gain access to a broken Ubuntu system’s files and restore GRUB2, consult the Ubuntu wiki.
READ NEXT- › Wi-Fi vs. ZigBee and Z-Wave: Which Is Better?
- › What Does “FWIW” Mean, and How Do You Use It?
- › How to Automatically Delete Your YouTube History
- › What Is “Mixed Content,” and Why Is Chrome Blocking It?
- › How to Manage Multiple Mailboxes in Outlook
So I've done something REALLY stupid, and I should know better, as I've been Dual-booting Windows and Linux on every computer I've had since I was 12. My current machine is a Toshiba laptop with Windows 7/Ubuntu 14.04. Today I decided to install Windows 10 Tech Preview on another partition. I guess I was forgetting that this would replace GRUB. The Win10 Boot loader recognizes Windows 7, but not Ubuntu. I know how to replace GRUB with Windows boot loader, but not viceversa.
Right now my priority is to bring back GRUB to boot 7 and 14.04, as 10 is not important. But since I am at a place where people know what their doing, I would also appreciate anybody who could help me add 10 to GRUB, but like I said, 10 is not important at this point.
Thanks in advance!
Right now my priority is to bring back GRUB to boot 7 and 14.04, as 10 is not important. But since I am at a place where people know what their doing, I would also appreciate anybody who could help me add 10 to GRUB, but like I said, 10 is not important at this point.
Thanks in advance!