How to restore the grub bootloader


You know that feeling. You turn on your computer and it attempts to load but nothing happens.  It just hangs.  This tutorial will teach you how to restore the grub bootloader so that everything works again.

Ok the first thing we need is a Linux live CD, any distribution will do.  Insert the Live CD and allow it to load.  Once loaded you need to open a terminal.  We need to find out where your linux partition is installed so type sudo fdisk -l.  You will get a response similiar to;

Device         Boot Start     End     Blocks Id System
/dev/sda1     1    60801   48838  4001  83 Linux

Make a note of this as we will use this later.

Next we need to make a directory on the desktop and mount the partition where Linux is installed

so type sudo mkdir realroot.  Then sudo mount /dev/sda1 realroot.  You should now see your partition mounted on the desktop.

Last thing is to re-install grub into the partition.  We do this by typing sudo grub-install –root-directory=realroot /dev/sda.

And that is it.  Make sure you type sudo where stated above as you need to perform these commands  as root.  Close down the system and reboot.

If you found this blog useful then why not sign up to my RSS Feed for news, tutorials, views and general techie stuff!!

At ComTech I work with both Linux and Windows.  I can advise on setting up servers, networks (home and business) or sort out those little gremlins you might have.  Go to www.comtech247.net/contact-us for some good old fashioned advice.

This entry was posted in Blog and tagged comtech, device boot, fdisk, grub bootloader, linux, linux live cd, linux partition, reboot, root directory, servers. Bookmark the permalink.

6 comments on “How to restore the grub bootloader

  1. Yatin Shelar on said:

    Just Install the grub bootloader from the bootable dvd/cd which you have used during installation. And do not partition. Keep it as it is. Then restart.
    It will take hardly 5 – 10 mins depending on your computer’s speed.

  2. Fixing grub issues are a great topic – thanks for adding your how-to.

    It might be worth noting that grub-install is a legacy grub command, used by Red Hat and Suse, whereas a different repair process is needed for distributions that use the newer Grub2 (Ubuntu, etc.)

    I’ve also found the SuperGrub and SuperGrub2 live CDs to be handy in repairing grub issues.

  3. I’m not sure where you’re getting your information, but great topic. I needs to spend some time learning much more or understanding more. Thanks for excellent info I was looking for this information for my mission.

  4. I want to thank you so much for that job you have made in writing this piece of writing. I am hoping the same most reliable work by you down the road too.

  5. Yeah bookmaking this wasn’t a bad determination outstanding post!

  6. I got what you mean, thanks for putting up. Woh I am delighted to find this website through google.

Leave a Reply

Your email address will not be published.

50,731 Spam Comments Blocked so far by Spam Free Wordpress

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>