Pages

The Boot loader is one of the most important aspects/programs of all operating systems. Whether its GNU/Linux, MS Window or Mac OS, etc it must be present!. And it is also a very fragile one as well. That's why having a recovery disk is also very important otherwise, say you're a bit new to all these "stuff", then you might easily end up losing data on your hard disk drive for instance.

Anyhow, there are primarily two main boot loaders can be seen in computers, one type is called the primary boot loader which represents a small piece of code/instructions that lets you computer to boot or load the most primary software contents without problems (that are closely related to the actual hardware, such as sending display signals to the Monitor screen or checking your RAM for errors for instance). This is usually stored in a ROM (read only memory) or EEPROM chip. The best example for such a Boot loader is the BIOS on your computer's motherboard.

Although the functions of a primary boot loader can be quite limited because those ROM chips usually have smaller capacity + since every operating system has a way of its own doing things, it's almost impossible to add all the details into the ROM. Even if we put our OS boot information into it, yet it can be quite hard to update it whenever the OS developers want since updating a BIOS chip has is "risks".

As an answer to all these issues they came up with another kind of boot loaders that run after the BIOS|primary boot loader is executed called secondary boot loaders. They're usually stored in your HDD/USB, etc, a place called MBR (master boot record). Now, these type of boot loaders are OS specific (not always true because they do have the ability to boot into other OS boot loaders. Multi OS boot for instance) and are behind the perfect execution of your operating system into your RAM.

Although there are several types... yet in GNU/Linux there are primarily two main BL can be identified. One is called Lilo and the other is called GRUB. GRUB is the primary one (if I'm not mistaken) these days which is an official part of the GNU project as well.

There can be many occasions a boot loader can be "corrupted"... say due to a virus attack or while trying to install/reinstall a boot loader or can occur after using a disk repair app in GNU/Linux (yes, it's possible) . When it comes to GRUB, in GNU/Linux you can install/reinstall GRUB loader without any GUI, even if your GNU/Linux PC Laptop is un-bootable, as long as you have the Live CD, etc you can use a command called "grub-install".

But then again, when you have an excellent grub installer GUI, why the heck u wanna do that! :). Sorry to drag you along with all these "related" details (just kinda felt like writing em)... if you want to easily control your GRUB boot loader in Ubuntu, then there is an excellent, GTK written GUI called "Boot-Repair".

This "window" is not available for those of us who use the original, official Ubuntu LiveCD... thus once installed and run we should be prompted by the below one instead...

Main features...

*. Recover or Repair your Grub code in MBR when you can't even boot your OS.

*. Repair it within the OS (you know, even if you removed your boot loader, as long as you don't reboot your PC, you're gonna be fine, for a while :P)

*. Reinstall the loader.

*. Change the location of the GRUB installation (you know, installing it into an another HDD, etc).

How the heck can I use it if I can't boot into my Ubuntu desktop Gayan!, you... nutcase?

Well my friend, use your Live CD or Live USB... boot into your desktop using those media and simply instal the Boot-Repair using the same command. Or I think you should be able to run it in the "/usr/bin" directory if no internet connection is available. In that sense, we can actually create a Linux recovery disk/LiveCD by using this app that should help to access/recover our data without even losing a single byte! :D. Good luck.

Man i have 2 HDD. One running Windows 7 and the other one has ubuntu. I have a dual boot. Windows 7 works fine but when booting in ubuntu i can't by pass the grub screen. I can't go to Ubuntu desktop at all. It's just stuck on the grub screen. If i use the boot loader how can i be sure it is not going to mess up my windows 7 ?

Okay... now I assume that you have installed GRUB to the other HDD in which you have Ubuntu and the Win 7 is in a separate HDD.

If you have the Ubuntu Live CD, then this is what you can do. Boot the Live CD and install the app and run it.

1. First remove/uninstall your current GRUB from the app.

2. Then re-install the GRUB which should detect both your Win7 and Ubuntu and make sure to install the GRUB in the HDD that you have Ubuntu.

Then reboot and your system should work fine. Now I know that you know this, but wrote just in case.

But as a direct answer to your question.

If you install the GRUB into the other HDD where you have your Ubuntu, then the WIN 7 MBR will not be modified my GRUB under any circumstances. Anyhow, just make sure...

*. to install the GRUB on the Ubuntu HDD thus no matter what the GRUB does all these changes will be made within the HDD that you have Ubuntu, not Win7. So partition table, Data, MBR, etc in Win7 HDD should be fine since the GRUB is not installed in that HDD.

But I cannot personally guarantee anything... so use it at your own risk. Hope this was helpful. You can manually override the original Win 7 MBR by using the below method if necessary.

i already installed windows 7 in C drive and Ubuntu 11.04 in F drive in my computer. Due to some problem of windows 7, i had to format c drive and re-install windows 7 on c drive.Now my system directly load windows 7.Now it doesn't show Ubuntu in windows boot manager window. How can I show that Ubuntu option in windows boot manger window and How can I enter into Ubuntu OS without reinstalling Ubuntu. please help me..............

I deleted two of my previous comments because I thought they may confuse you a bit more :/... so in general you should do the below steps to recover the original Ubuntu GRUB menu.

1. Insert the Ubuntu 11.04 Live CD and boot into the desktop. Then install the application using the command in the post.

Then use the below command in your Terminal window to run it.

sudo boot-repair

Even though in the post you can see two screenshots but apparently (I update a little "description on the first screenshot) you won't be getting that window with 4 choices thus once run it should open a new window that looks like the second screenshot instead.

Now I assume that you have a single HDD with multiple partitions and then from that window click on the "Apply" button. Now THIS SHOULD FIX YOUR ISSUE.

2. If however this does not, then you can try clicking on the "advanced" option and use the one that says..

"(Required Internet) Manually Purge and reinstall of the GRUB of..."

But as said.. the first method should solve your issue but if everything fails.. then you can read more from the below link to find a way out

I've to reinstall grub after installing Seven. I've only one hdd with Seven on c: and ubuntu 11.04 with /boot,/root, and /home partitions.The standard execution of boot-repair doesn't give errors, but after reboot there's still the Seven menu with his list (Seven, Seven safe?...etc).In the advanced options, in the list with the default OS there's only Ubuntu.If I choose to manually delete and reinstall grub the command

Well as far as I know (as said I ain't an advanced geek at this... sorry about that :/) if you remove the "grub" using the apt-get you'll run into trouble.

Although I'm not sure but when apt-get removes "grub" it only removes the installed files not the actual "grub" portions on the MBR.

So you'd basically have a PC with Grub in the HDD MBR but the real "grub-engine" (installed files of the GRUB) on the Ubuntu is missing... which is certainly not good.

I may be wrong here since if you go with the above command and when apt-get removes the "grub" packages, it might also uninstall/remove the GRUB on your MBR properly.

Anyhow it seems that even after running the boot-repair, it has failed to install the GRUB on your HDD and again what's the point of removing GRUB when it's not installed.

But, since you have a the usual suspects list of MS Windows (safe-mode, etc) rather than the standard booting straight away, may I humbly advice you to first properly boot into MS Win7 and log-in to your desktop and then do a proper reboot.

The idea is to get rid of the "Win 7 boot-list" which only appear if the OS wasn't able to boot properly in the last occasion and let the Win7 to "update" its MBR properly.

So first get rid of the "list" and after solving that again try to re-install the GRUB using the tool in Ubuntu LiveCD environment???

OR if it fails then

You can try to reinstall the original Win7 boot-loader by using the steps laid-out in the below link

http://support.microsoft.com/kb/927392

and then try to re-install the GRUB in LiveCD using the tool (an update is appreciated :) )

i have installed ubuntu 11.04 inside windows. it was working fine for few days after installing necessary updates for it now it can not boot ubuntu 11.04 without help of usb boot disc. instead it shows only black screen with grub command prompt. help me out cannt always use my usb drive!!!

Well, thanks to you I just realized that A new version of Boot Repair is released which makes the whole process so much easier!.

Just boot to an Ubuntu liveCD/USB disk environment and simply install the app using the commands given in the post. Then press "Alt" + "F2" keys and enter the below command

boot-repair

After few seconds, you should see a window with two options and from that choose "Recommended Repair" which should solve most of the GRUB related issue...

Restart your PC and if you're lucky, the GRUB should be fixed... if you want more additional options then click the "advanced" button but if you don't know what you're doing, better stick with the above mentioned "Recommended repair" option... good luck.

Thank You!This saved me a lot of effort.In my case Samsung N145 I mistakenly chose Vista recovery option in boot menu and then I just could not wait for it to finish and just turned off the notebook. After that boot menu wasn't loading. This brilliant tool saved it.Thanks again!

I used this information this morning to rescue my blunder with StartUp-Manager tool. I had it booting into Memtest accidentally as I was trying to steer my GRUB away from the 3.0.0.13 Kernel. My Lenovo w520 doesn't play nice at boot time with the upgrade. 2.6.38 is what works for me. What a mess. Your post was most helpful and easy to follow. I'm a linux enthusiast and folks like you make it possible for everyone to enjoy Linux if they are just willing to "look into it" when they have a problem. Thanks much

dear friend i'm using both win7 and ubuntu 11.10.to day lost my grub now automatic boot only win7 not show any grub menu and not boot ubuntu plz help friend .urgent b,coz now i'm only use win7 i want both os and don't want to re install ubuntu agn b,coz i installed very good software in ubuntu .plz help me how to back my ubuntu (bgub menu)

hello friend, i am using ubuntu 11.04 and i am having trouble with install/remove package from ubuntu software center due to some boot-repair problems...and also i checked for the exact problem using command "dpkg --configure -a" as a root-user and i am getting error as like below:

ell "clean-gui" is automatically installed with "boot-repair". But I'm guessing is that perhaps you were trying to install it while "YannUbuntu" (the developer) was updating his PPA.

Try installing boot-repair after sometime (few mins or an hour for instance).

As long as you've added the boot-repair PPA to Ubuntu these packages should be automatically installed. So as far as I know there's very little we can do about it.

But you can try to install it manually by using the below command (the boot-repair PPA must be added to Ubuntu first)

sudo apt-get install clean-gui

If this succeeds, then put the boot-repair installation command (as shown in the article) and try proceeding.

If this is simply some other issue (bug or something beyond my knowledge) then you might wanna go to the below link (PPA of boot-repair) and have a loot at "Bugs" and "Answers" tabs or you can put together a question yourself as well.

Perhaps someone is having the same issues and who knows you might find your answer there if waiting few mins doesn't work. Good luck.

I made a live usb to install ubuntu-10.04.3-desktop-i386 usingUniversal-USB-Installer-1.8.7.6. I ran it, and clicked on installinside windows. After some processing, I was given an option to rebootmy pc either now or later. I clicked on later, and when I rebooted, Ididn't have an option to go to Ubuntu.

I installed boot repair via terminal method as given onhttps://help.ubuntu.com/community/Boot-Repair

Then a clicked on recommended repair. It did its work, but when Irebooted, I still don't have an option to boot into ubuntu.Boot-repair displayed the link http://paste.ubuntu.com/795741/

Well, as far as I know the Wubi (the installer that installs Ubuntu inside Windows file system) Ubuntu installer does not use GRUB. Instead it edits the existing MS Windows "boot.ini" file (and I've never tried that myself either).

So I don't think there's anything that Boot-repair can do here since there's no GRUB to begin with.

The best thing that you can do now is to uninstall the Ubuntu installation and try doing a re-installation.

If that doesn't still work and you'd wanna install Ubuntu, then I humbly advice you to install it the standard way (having a separate partition, with GRUB, etc) which should work almost all the time.

Good luck.

PS: You can find more about Wubi installer from the below links as well ...

WOW! This worked PERFECTLY! I just finished a triple-boot (Lubuntu 11.04, Mint 11 LXDE, and CrunchBang Statler) on my Asus 1215, then did a little bit of resizing with gParted. I don't know what I did wrong, but I got the No Partition error. ~PANIC~ Discovered and downloaded Boot Repair ISO on my desktop machine, created a bootable version with UNetbootin. Fired it up on the Asus, clicked the first button "Recommended Repair", and moments later, I got my triple-boot Asus back...like nothing ever happened. Great tool!

While trying to format a flash drive, I rushed into using some commands (dd if=/dev/zero of=/dev/sda).I was not sure if it was working, so I forced kill the terminal window before logging off. When I tried to boot my laptop later, I get a message that no boot sector found.

Is it possible to fix it, if not then is it possible to get my data from the disk

Thanks for the article! Previously, I just use ms-sys, however, it is no longer in the repos for ubuntu!!! My last live usb for fixing Windows MBR was probably 10.04, so I'm not sure when ubuntu stopped ms-sys.

Anyhow, thanks so much. This is needed when I "reflash" a new HDD onto a computer... I just dd file contents and fix the MBR and on with life.

Great article! I just followed the steps, ran the boot repair wizard, and the computer started up again perfectly! Looks like it was a simple case of an update corrupting the boot loader. Thanks a million!

My system is a laptop running windows 7 as the host for virtualbox with ubuntu 11.10 as the guest. Almost as soon as I click Start in vbox manager memtest starts up and I'm dead in the water. How can I access grub in this situation to repair it? I think memtest got started when I did a kernal change in startup manager.

I use Ubuntu on my apple Macbook Pro. I've been using Ubuntu 9.04 for years and loving it. It sounds like today I need to reinstall GRUB though. Here is my description of the problem:

My MBP is set up with rEFIt, so when you boot up it first goes to the rEFIt menu screen where you select OSX or Linux. If you select Linux (which I do 99% of the time), it then goes to the standard GRUB menu screen, where upon selecting Ubuntu (the only OS set up there), it boots up into Ubuntu. This morning out of the blue when I boot up and select Linux at the rEFIt screen, it acts as though a GRUB menu screen is about to appear. But instead of that, it just gives a black screen with the words "GRUB" appearing in the upper left hand corner of the screen. So I am guessing that perhaps GRUB became corrupted somehow. What do I have to do to get GRUB working again? (This is urgent-- I can't do any of my work until GRUB works, so I can get into Ubuntu.) Thank you!

I thought my little HP Mini was dead. I would only boot into mem test and stay there. It sat collecting dust then I trew in a liveusb and it booted from that so I new it was software and not hardware. I found your site using duckduckgo. Spent a few minute ad my little netbook is alive again and no lost data or need to reinstall. Thank You!

Thanks for this article, Gayan ! I have been spending a day trying to get grub installed on a 4K sector disk, after migrating and aligning partitions from a 512byte sector disk.Boot-repair solved it all instantly, saving me from a fatal headache....