Google Plus

Fixing a few common grub errors | Broken Bootloader and error 17/15

Written by Mel Kham on . Posted in Linux tutorials

Grub is short for GNU GRand Unified Bootloader. To be simply put, it’s a boot loader package from the GNU Linux project. It’s the common and reference implementation of a multiboot Linux system. It allows you to choose which operating system or specific kernel to boot into.
In this article, we’ll be looking into figuring out some common grub errors and hopefully, work out a fix for them.

Repairing a broken Grub 2 bootloader:

There are tons of us here who broke their grub thanks to autoupdates through apt or similar. Hopefully, this will allow them an way to fix their system without reinstall.
Grub now features an advanced rescue mode, truly a godsend for people who somehow messed their MBR tables up.
You want to trigger that and get into grub. Then execute the commands below to get back into an working desktop first.
ls
set prefix=(hdX,Y)/boot/grub
set root=(hdX,Y)
set
ls /boot
insmod /boot/grub/linux.mod
linux /vmlinuz root=/dev/sdXY ro
initrd /initrd.img
boot 
The X and Ys are to be filled in with your own HDD information. If you only have one HDD, it’ll be X=0, Y=1 and so on.
At this point, you should atleast be able to boot up normally. You’re almost done.

sudo update-grub 
sudo grub-install /dev/sdX

Execute those two commands, replacing X with the partition your linux is installed on. For me, it was ‘a’. Voila! You’ve fixed your broken ‘auto-updated’ MBR records.

Fixing grub error 17/15

Grub error 17 is one of the most common error messages that you’re likely to encounter using the Grub bootloader. The root cause behind it is a messed up partition table disk order.
To fix this, grab a live cd and boot into your desktop.
Execute the following:

sudo fdisk –l

You’re likely to get something like the following:

Disk /dev/sdb: 750.1 GB, 750156374016 bytes
255 heads, 63 sectors/track, 91201 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x000dc2a4

Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1        1275    10238976+  fd  Linux raid autodetect
/dev/sdb2            1275       91074   721306624   fd  Linux raid autodetect
/dev/sdb3           91074       91201     1022976   82  Linux swap / Solaris

Partition table entries are not in disk order
If the bolded line exists, you’ve just found your problem.
Fixing this is easy. Execute the following.

sudo fdisk /dev/hda

hda as in the whole hard disk, not hda1 or stuff like that.
choose option x (extra functionality (experts only)) and enter.
then select f (fix partition order) and enter.
then select option w (write table to disk and exit), and enter. You can exit now.
Now, you need finalize this in grub.

$ sudo grub
grub > root (hd0,1)
grub > setup (hd0)
grub > quit

Obviously, you need to know which HDD houses your OS and replace the 0,1 and hd0 accordingly.
Congratulations, you’ve just fixed Grub Error 17. Grub error 15 can be fixed in the same way as well.

For questions please refer to our Q/A forum at : http://ask.unixmen.com

Mel Kham

Founder of Unixmen, Living in Amsterdam. Am working in my free time to help people to understand the Opensource and to explain them in easy way how to make the fist steps to the the light. Working day and night with my Co-founder Zinovsky to keep this website live even with less resources.
  • http://all-tech-thoughts.blogspot.com CMD

    Most useful recovery tool i’ve encountered for Grub is Super Grub 2 CD, it should be in every Linux admin’s toolkit :)

  • Enzoblade

    What happens If you deleted Linux and only have windows

  • Bob

    enzoblade, read the article and get a live cd ?

  • Emmatimothy

    for those who are windows users to restore your window partition follow the procedure at http://how-2-s.blogspot.com

Like us on Facebook

This week Top Posts

Write for us

Recent Comments

SK

|

Yes we can. What kind of help you need? We are doing outsourcing and technical support for Linux and Open source worldwide. To know more about the details visit here.

ClintB

|

After install as above, run shell script /opt/Citrix/ICAClient/wfica.sh manually and note lib errors still occur. I had the x64 motif loaded but had to manually install the x86 too. Got that from http://rpmfind.net/linux/rpm2html/search.php?query=libXm.so.4 Even after that, I still had to do a “yum install alsa-lib.i686 alsa-lib.x86_64″ to resolve any additional libasound.so.2 errors. Once those two lib issues were resolved, Citix Web Interface launched apps fine by telling browser to open launch.ica using /opt/Citrix/ICAClient/wfica.sh. Good luck Ernesto!

AD

|

I need some Help on Linux,can you guide me ?

Edson Carlos

|

In debian no found. I need link download install in linux debian

jacky can

|

You can actually unzip your secret archive by leaving out the -t option, instead using:

unzip newPhoto.jpg

 
IDG Tech Network
Copyright © 2008-2013 Unixmen.com .
Maintained by Anblik .