How can I repair grub? (How to get Ubuntu back after installing Windows?)


Answer #: 1

When you install Windows, Windows assumes it’s the only OS on the machine — or at least it doesn’t account for Linux. So, it replaces GRUB with its own boot loader. What you have to do is replace the Windows boot loader with GRUB. I’ve seen various instructions for replacing GRUB by mucking around with GRUB commands or some such, but to me the easiest way is to simply chroot into your install and run update-grub. chroot is great because it allows you to work on your actual install, instead of trying to redirect things here and there. It’s really clean.

Here’s how:

Boot from the live CD. Determine the partition number of your main partition. GParted can help you here. I’m going to assume in this answer that it’s /dev/sda2, but make sure you use the correct partition number for your system!

Mount your partition:

sudo mount /dev/sda2 /mnt # make sure that sda2 is correct!

Bind mount some other necessary stuff:

for i in /sys /proc /run...
0 0

Well I finally solved this, I decided to use the windows boot menu to access to linux, first, to repair the windows boot, I followed the instructions of this post

Next, after I could access windows, I followed the steps on this post

You may want to make a backup copy of your windows partitions using either clonezilla, o Macrium Reflect ( it's for windows, and I thing the easiest way to clone disks from windows, just in case something goes wrong, because out there there are some weird hard drives....

So, after I added the windows boot entries, I could access linux, but it went directly to the grub, so I edited the grub file setting the timeout to zero, so it goes straight forward to Linux...

0 0

Currently I boot to grub, with a "Windows Longhorn/Vista chainloader" entry. It is not Grub2.

Thence a choice of XP 32bit, Vista 32Bit, Memory test (BCD Customised a little).

I intend to install Windows 7 32Bit. These are my fears :

a) Will Win7 destroy my BCD bootloader customisation ?
b) Will Win7 automatically find the BCD bootloader entries left by Vista ? (or does it build it's own).
c) If I backup the MBR sectors and restore post Win 7, will this get me by ? Maybe for fallback only ?

I don't want to rebuild from the ground up.

I plan to install windows 7 on a new disk, and assume it will find the previous Windows versions, and I expect to end up with the Win7BCD Bootloader, whereupon I will use my Linux Distribution's live CD to repair GRUB.

Things should just work.

Cheers to...

0 0

source : dual boot – How can I repair grub? (How to get Ubuntu back after installing Windows?) – Ask Ubuntu

When you install Windows, Windows assumes it is the only operating system (OS) on the machine, or at least it does not account for Linux. So it replaces GRUB with its own boot loader. What you have to do is replace the Windows boot loader with GRUB. I’ve seen various instructions for replacing GRUB by mucking around with GRUB commands or some such, but to me the easiest way is to simply chroot into your install and run update-grub. chroot is great because it allows you to work on your actual install, instead of trying to redirect things here and there. It is really clean.

Here’s how:

Boot from the live CD or live USB, in “Try Ubuntu” mode. Determine the partition number of your main partition. GParted (which should already be installed, by default, on the live session) can help you here. I’m going to assume in this answer that it’s /dev/sda2, but make sure...
0 0

Whatever you say against Ubuntu, you can’t just make it less popular. It is the most popular Linux distribution. Many companies rely on this distribution. I personally use it on my laptop and in my servers. Normally people use windows, and when it comes to Linux it becomes a whole other matter. If someone use Ubuntu but later he wanted to install install latest windows or old alongside Ubuntu, he may face problem as loosing Ubuntu. That is what i am gong to explain “Ubuntu Recover Procedure”.

Ubuntu use “Grub” as boot manager(loader) but windows has different. A boot loader is a computer program that loads an operating system or some other system software for the computer after completion of the power-on self-tests; it is the loader for the operating system itself, which has its own loader for loading ordinary user programs and libraries. When Windows is installed it can’t recognize other Boot Loaders entries. That is why it generates a fresh menu where only Windows...

0 0

After reinstalling Windows in the computer dual boot with both Windows and Ubuntu Linux,you need restore grub because mbr has been rewritten.This tutorial shows how to restore grub 2.

Update:Today I ghost my XP system,but after restore grub,I cannot boot into XP by clicking the old windows option in grub menu.So you’d better to run this command to renew the grub2 boot list after trying following method:

sudo update-grub

0.) Using Ubuntu LiveCD/LiveUSB and boot-repair (gui tool).

If you have the LiveCD or LiveUSB you installed Ubuntu from, insert into your machine and boot from it. Then run 3 commands into terminal (Ctrl+Alt+T) to install boot-repair:

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

If you don’t, directly download boot-repair.iso file and burn into liveCD or liveUSB (UNetbootin) then boot from it.

Open boot-repair, click Recommended repair to repair grub2...

0 0

Hello. I am sure there are plenty of newbies around when it comes to linux, myself included. This is a guide of how to repair grub in the event your windows 7 removed the grub during the installation.

First thing that you'll need to do is to boot from a kali linux live cd. After that, go to gparted so that you can get to see where kali was installed: usually it's in the file system that ends with ext4, depending with the file system you used during the installation. In my case, the kali linux system was in sda3, but it varies with different systems.

From there, you'll have to use the terminal for the following commands:


mount /dev/sda3 /mnt mount --bind /dev /mnt/dev mount --bind /dev/pts /mnt/dev/pts mount --bind /proc /mnt/proc mount --bind /sys /mnt/sys chroot /mnt grub-install /dev/sda update-grub exit umount /mnt/dev/pts umount /mnt/dev umount /mnt/proc umount /mnt/sys umount /mnt

This will restore the old kali linux boot loader, however,...

0 0

If you have installed Linux on its own partition in a dual-boot configuration, there’s no easy uninstaller that will remove it for you. You will need to delete its partitions and repair the Windows boot loader on your own.

How you uninstall Linux will depend on how you’ve installed it. If you installed Linux as your only operating system, you’ll have to reinstall Windows over Linux to get your Windows system back.

If You Used Wubi

If you installed Ubuntu or a similar Linux distribution like Linux Mint with Wubi, you’ll have an easy uninstaller. Just boot into Windows, open the Control Panel, and locate Ubuntu in the list of installed programs. Uninstall it like you would any other program and the uninstaller will automatically remove the Ubuntu files and boot loader entry from your computer.

Note that this entry will only be available if you installed Ubuntu inside Windows with Wubi.

If You Installed Linux on Its Own...

0 0

I always get this error when I try to open pdf files with evince:

error while loading shared libraries: /usr/lib/x86_64-linux-gnu/ invalid ELF header

Can someone please help me?

Other Tips. I am having problems with Adobe Flash in Ubuntu, what are my options? As you have identified - the best solution is usually to follow this Q&A to install flash. It does work for the vast majority of users. Flash-Aid was discontinued by it's author and is unknown if it will be back, the following are kept only for historical reasons. As an alternative, one of the best tools I have found that allows you to configure Flash correctly during installation is the Flash-Aid addon - use the author's site or search on the Firefox addon-manager for Flash-Aid This will remove any remnants of of Flash installation and install flash directly from the Adobe Website. During the wizard installation you have a few configuration options that you can try to resolve...

0 0


Not sure how lightweight Gparted's liveCD is.

Install MBR from liveCD/DVD/USB, Ubuntu install on sda5 and want grub2's bootloader in drive sda's MBR: Find linux partition, change sda5 if not correct:

sudo fdisk -l

confirm that linux is sda5

sudo mount /dev/sda5 /mnt sudo grub-install --root-directory=/mnt/ /dev/sda

The above command should work but they now suggest this command for grub 1.99 with Natty 11.04 or later - uses boot not root.:

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

If that returns any errors run:

sudo grub-install --recheck --root-directory=/mnt/ /dev/sda

If no errors on previous commands reboot into working system and run this:

sudo update-grub

I unusually suggest Boot-Repair but do not know if it runs or not (it does work in several distributions) as it needs some standard utilities. It is not a huge download (mostly bash script) and does have a Lubuntu based version to...

0 0

I never got in trouble by using these instructions:

First of all, you must start your system from a live cd. Then


This method of installation uses the chroot command to gain access to the broken system's files. Once the chroot command is issued, the LiveCD treats the broken system's / as its own. Commands run in a chroot environment will affect the broken systems filesystems and not those of the LiveCD.

1) Boot to the LiveCD Desktop (Ubuntu 9.10 or later). Please note that the Live CD must be the same as the system you are fixing - either 32-bit or 64-bit (if not then the chroot will fail).

2) Open a terminal (Applications > Accessories > Terminal).

3) Determine your normal system partition - (the switch is a lowercase "L")

sudo fdisk -l

If you aren't sure, run

df -Th

Look for the correct disk size and ext3 or ext4 format.

4) Mount your normal system...

0 0
Boot-Repair tells you that you have grub installed to the PBR or partition boot sector of the NTFS partition. Windows has boot code there, so that is why Windows will not boot.

Fix for most, a few have other issues, better than windows fix in many cases as it also fixes other parameters:
If win7 use small 'system reserved' NTFS partition instead of the partition where windows was installed for win7
This has instructions on using testdisk to repair the install of grub to the boot sector for windows from Ubuntu or Linux LiveCD.
You want to get to this screen:

I think this is the linke Boot-Repair gave since it is the same author.
[HowTo] Repair the bootsector of a Windows partition - YannBuntu

Only some BIOS have issues with the...

0 0

Boot-Repair is a GUI tool to repair various boot issues you may encounter in Ubuntu like when installing Windows or another Linux distribution and you can't boot Ubuntu or GRUB is not displayed anymore, some upgrade breaks GRUB, etc.

Boot-Repair lets you reinstall GRUB bootloader with a simple click, but there are also some advanced options available if you want to specify the partition where GRUB should be installed or purge and reinstall GRUB. The application also allows you to restore the original boot sector (MBR) if it was saved using


(another application created by the Boot-Repair developer) and select the default OS.

You can use Boot-Repair from a regular session, but since its supposed to repair the GRUB, you'll most probably need to use it from a Live CD so boot an Ubuntu Live CD and then install Boot-Repair using the commands below (yes, you can install it on the Live CD!):

sudo add-apt-repository ppa:yannubuntu/boot-repair sudo...
0 0

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...

0 0

When you get a GRUB rescue prompt, it means that the GRUB bootloader cannot locate its modules from the partition that contains them in /boot/grub. The reason for this is that the code that fits in the drive MBR record is tiny, and so its main purpose is to locate and load the rest of the bootloader code. Once it's loaded its modules it can present the GRUB menu and handle the rest of the boot process. If it can't find the modules, it presents a very limited rescue prompt.

So, what you are seeing is totally normal if you repartitioned, thereby breaking the reference the bootloader had to the partition containing the boot modules.

Since you can boot manually, the simplest fix is to manually boot and reinstall the bootloader in the MBR so that it has the correct reference to your partition. The way to do that is:

sudo grub-install /dev/sda

This assumes you boot from /dev/sda (most cases, but if not, replace it with the correct drive).

This solution is far...

0 0
0 0

This is the common problem which is faced, when you try for dual boot. Easily Recover / Re-Install Grub in Ubuntu using Boot-Repair from live cd / usb. Boot Repair is the simple graphical tool used to repair, restore or reinstall the grub bootloader on Ubuntu. Now this tools has been updated with some new features in advanced option, using boot- repair you can also restore the MBR on Windows.


On dual boot once you update your Ubuntu OS, Windows / Fedora will not be listed on your grub. After installing Windows / Fedora your Ubuntu will not boot anymore and its grub may be wiped out. To restore it follow the steps below

To Reinstall Grub

You need to have Ubuntu Live CD or Live USB. Normal session can be used to repair the grub. Boot using your Ubuntu Live CD or Live USB, while booting choose Try Ubuntu.


Once booted then open a terminal, and run the following command one by one to install the boot...

0 0

This page details the procedures for installing and reinstalling GRUB 2. The information applies to most versions of GRUB 2, but is specifically written for version 1.99. GRUB 1.99 is included on Ubuntu releases 11.04 (Natty Narwhal) and later. For more information on a variety of GRUB 2 topics, please visit the GRUB2 main page. For information on converting to or from GRUB Legacy, please view the Grub2/Upgrading community doc.

The GRUB 2 bootloader is included on all currently-supported versions of the Ubuntu family. GRUB 2 can accomodate traditional computer firmware such as BIOS as well as the newer EFI/UEFI standards. It is compatible with MBR, GPT and other partitioning tables.

All references to GRUB pertain to GRUB 2. Where GRUB 0.97 is discussed, it will be referred to by version number or as GRUB Legacy.

GRUB 2 installation is automatically incorporated into a normal Ubuntu installation. Input required by the user for the initial setup is very...

0 0

I installed Windows 8.1 on an MSI GE60 laptop; then proceeded to partition it using GParted (resized the NTFS partitions) and installed Ubuntu 14.04.1 LTS in the free space I created /dev/sda8.

When I run bootinfoscript after logging into Ubuntu, the output looks as follows (see below, excuse the rather long cut-paste). The problem I am having is that I do not have a grub boot menu that allows me to choose which OS to boot into (I used to be able to do this with 8.04 Hardy Heron and 10.04 without much trouble on an older laptop). It boots into Ubuntu by default. The only way I am able to boot into Windows is by hitting the delete key when the MSI logo appears, entering BIOS, and changing the value of the option for Boot Mode Select option from Legacy to UEFI.

Appreciate if anyone has any ideas or suggestions to help me get the grub boot menu option which gives me both OS choices to boot into, so that I don't have to go into the BIOS everytime I want to work in...

0 0

Boot-Repair is a simple tool to repair frequent boot issues you may encounter in Ubuntu like when you can't boot Ubuntu after installing Windows or another Linux distribution, or when you can't boot Windows after installing Ubuntu, or when GRUB is not displayed anymore, some upgrade breaks GRUB, etc.

Boot-Repair lets you fix these issues with a simple click, which (generally reinstalls GRUB and) restores access to the operating systems you had installed before the issue.

Boot-Repair also has advanced options to back up table partitions, back up bootsectors, create a Boot-Info (to get help by email or forum), or change the default repair parameters: configure GRUB, add kernel options (acpi=off ...), purge GRUB, change the default OS, restore a Windows-compatible MBR, repair a broken filesystem, specify the disk where GRUB should be installed, etc.

For the purpose of helping the forum and IRC members help you diagnose issues with your boot setup, Boot-Repair...

0 0