Ubuntu

GRUB Error 17 (Stage 1.5)

Asked by Kiko Barcelli on 2009-04-06

Hello,
I've had dual booting Ubuntu / Windows XP for a long time... I didn't do anything new, just trying to reboot and crashed...
I tried to re-boot again and I am getting the message "GRUB Error 17", from reading the GRUB manual it means file not found, but all the structures (partitions and folders) are there...
I managed to boot up from a LiveCD and I can still access the files in the HD.
Can anyone help me to know what to do next?
Regards,
Kiko

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu grub Edit question
Assignee:
No assignee Edit question
Solved by:
Tom
Solved:
2009-04-08
Last query:
2009-04-08
Last reply:
2009-04-08

Just go to System->Administration->Synaptic Package Manager.There search for grub and reinstall it.It should work.

Kiko Barcelli (kikobar) said : #2

Shall I do this from the LiveCD?
I haven't booted up from my HD, I did it from a LiveCD

Ty to see this:

http://ubuntuforums.org/showthread.php?t=981371

Hope this helps.

Kiko Barcelli (kikobar) said : #4

Hi Claude,
I am able to boot from LiveCD, I can browse my HD... there must be something wrong somewhere...
I can open the file /boot/grub/menu.lst and it is intact.
What shall I do next?

Have you changed or removed same partition?

Just Try installing the grub package from live cd.I think it would work.

Tom (tom6) said : #7

LiveCd, top taskbar

Applications - Accessories - Terminal

into the terminal/command window/console type

sudo grub

It asks for your normal user password, not your SuperUser/Root one and gives no stars or any other clues about how long your password is or how many letters you've already typed. Note that on a command-line the "Tab" key can help show you relevant possibilities worth typing so try

root (hd

"Tab" to find which drives you could install grub onto, probably you want drive 0 so type "0" and then a comma which should make the command (so far) look like (but don't enter this because it's still incomplete)

root (hd0,

now "Tab" again should show which partitions on the drive are available for putting the grub files on. If you are dual-booting with Windows then it's likely that Windows is the first partition and that hopefully means that your linux-swap is the 2nd partition which would mean Ubuntu would be on the 3rd partition. Many other set-ups are possible and linux is great in allowing variations and flexibliity to suit different needs and different hardware. Grub is meant to mainly talk to the machine, so it starts counting from 0 - so sda3 becomes (hd0,2). So once you find out which drive and partition Ubutnu is on then finish the command which i will assume is (but the numbers might well be different for you)

root (hd0,2)

Now, finally, make sure that the mbr is written to and then quit out of the grub-command-line. Again i'm assuming that your machine uses the master hard-drive but it's possible that you have something else set-up, although that's unlikely

setup (hd0)

quit

It does sound like it might be wise to backup your crucial data. Does your hard-drive sound quite loud? Grinding noises perhaps? You could just be missing some crucial grub files by some other accident and these things do happen from time to time. Please let us know which drive and partition you use for Ubuntu and then we can give a slightly easier-to-follow answer.

Good luck and regards from
Tom :)

Kiko Barcelli (kikobar) said : #8

Tom,
This is a great an very clear explanation.
I started the procedure and everything went as you described, but before doing anything I would like to share with you the partition structure:
If I use GParted:
/dev/sda1/ ext3
/dev/sda2/ fat32
/dev/sda3/ fat32 boot, lba
/dev/sda4/ extended
/dev/sda5/ linux-swap

if I use grub:
Partition num: 0, Filesystem type is ext2fs, partition type 0x83
Partition num: 1, Filesystem type is fat, partition type 0xb
Partition num: 2, Filesystem type is fat, partition type 0xc
Partition num: 4, Filesystem type unknown, partition type 0x82

Perhaps with this extra information you can help me better?

Thanks,

Kiko

Tom (tom6) said : #9

Ok, so in a terminal console just type (or copy and paste using the mouse)

sudo grub

root (hd0,0)

setup (hd0)

quit

and that's it :) Now a reboot should get you into Ubuntu and then we might need a little more work to get Windows booting but usually it picks up on the Windows too :)

Good luck and regards from
Tom :)

Ps Notice that sda1 = grubs partition 0
sda2 = partition 1
sda3 = partition 2
and grub can't install to linux-swap so it isn't setup to recognise sda5 as anything worth considering.

Kiko Barcelli (kikobar) said : #10

Hi Tom,
I tried and it seemed to work, but when I rebooted I got stack with the same problem:

Stage 1.5
GRUB Loading
GRUB error 17

Any clue?

kreggz (jasonkregting) said : #11

Hey,

This has helped me out a few times now:
http://www.supergrubdisk.org/

You burn the iso to cd and boot it up

Then use doco:
http://www.supergrubdisk.org/wiki/Boot_Problems

Its really easy to use

Tom (tom6) said : #12

Yeah, kreggz answer often helps. I was also wondering if that part of your drive has become corrupted or something so was going to suggest making a tiny partition especially for grub and then try again what i said earlier but just change the numbers so it installs on the new partition. 150Mb would be more than enough for it. I would try kreggz way first though.

Good luck and regards from
Tom :)

Kiko Barcelli (kikobar) said : #13

Hi Kreggz, Tom,

Sorry to keep bothering with this...

I tried Super Grub Disk and it seems not to recognise my HD...

I have 2 HD in this PC, the first one (where the boot partition is) is a 465GB, the second one, which is just data, is a 57GB.

When I boot from the LiveCD, I can mount all the partitions of these 2 HDs... I can browse and open the files (I can even open and edit the menu.lst file, for instance).
Moreover, if I run GParted, I can map all the partitions (and I guess even modify them if I wanted).

But when I run Super Grub Disk, I can only see the small second HD (the 57GB), which does have any boot partition. I tried the Live Swap, but same problem.

For some reason my large HD is invisible to GRUB and I guess that is why I get the Error 17 (file not found) message.

Are further ideas?

Warm regards,

Kiko

Kiko Barcelli (kikobar) said : #14

Sorry... I little typo... "the second HD (the 57GB), which does NOT have any boot partition."

Tom (tom6) said : #15

Ok, in a LiveCd maybe try this mad idea. I'm not at all sure it will work but in a terminal console type

sudo grub

root (hd1,0)

setup (hd1)

quit

This should setup your data partition on the non-boot drive to bootup! Hopefully it will recognise that the only OS's are on your Master drive - otherwise you'll probably get a completely different error message!!

Only try this if you think it's worth it. At the moment your set-up is secure and we can get data off but trying anything like this might change that and not necessarily for the better.

Good luck and regards from
Tom :)

Tom (tom6) said : #16

I think i might also try

sudo grub

root (hd1,0)

setup (hd0)

quit

So that the mbr on the Master drive is setup to point at the grub-boot-loader that's setup again on your data drive. I would only try this if i tried the last answer i gave. It's risky though so i understand if you don't try it. I don't have enough experience with grub to know whether this answer is brilliant or really dumb.

Is your data drive really 57Gb? It's not got an extra partition? I have a 60Gb here that would be quite nice if it wasn't broken, certainly better than the drives i am using. I bet it's not really a full 60Gb either ;)

Thanks, good luck and regards (again) from
Tom :)

Kiko Barcelli (kikobar) said : #17

Hi Tom,

Many thanks for all your help.
At the moment I feel like taking a safe move... I think perhaps it is better to backup all my data now that it is possible and then wipe everything out and install again... it will be a painful waste of time though!
What do you reckon?
With regard to your final question, the 60GB is my old (very old!) HD... long time ago I added the new 465GB as primary and moved the old one as secondary... then I installed a new system in the new one and just kept the old one as extra storage...
The new one (the 465GB) is partitioned to accommodate both Windows and Ubuntu.
Now, coming back to my GRUB problem... this configuration and hardware have been working for about 2 years... what can make now GRUB not to see my HD?... I recall that just before all this started I had boot up cycle that it could not find the HD and crashed completely, then I boot up from the LiveCD and saw the HDs were still there... so I booted up again and now the HD was detected but now GRUB couldn't find its files...
Any further clue?
Many thanks and regards,
Kiko

Kiko Barcelli (kikobar) said : #18

ha, ha...!
When I wrote the last message I got a hint of what had happened...
When the boot cycle failed, the Bios disabled the primary HD!... so the only thing I had to do was to let it detect the HD again and voila!, next boot up worked!
What confused me was that even with HD not detected by the Bios, Ubuntu from a LiveCD was able to see it, map it and use it!.... this is new to me... any clue?
Thanks a lot for your help!

Best Tom (tom6) said : #19

Brilliant. So is this problem "Solved" now? Nicely found and fixed :)) LiveCd's, but i think only some LiveUsb's, do their own independent search for hardware on the system. Bios's tend to be quite old or limited and sometimes favours M$ systems so Linux has to do it's own checks on what really is connected. A hard-drive installed linux will expect to find much the same system as was there before it got shutdown, although it does often still do some of the checking - just not as much as a LiveCd has to.

Linux deals with a huge variety of different circumstances rather than force people into a constant upgrade cycle. It has academic based motives of curiosity and building up knowledge rather than profit based motives & limiting access to stuff.

Kiko Barcelli (kikobar) said : #20

Dear Tom,

I will say no more.
Those are the reasons that made me switch to Linux some years back, decision of which I am very happy and proud about.

Have a great day and many thanks for all your help and patience.

Kiko

Kiko Barcelli (kikobar) said : #21

Thanks Tom, that solved my question.

Tom (tom6) said : #22

Ahhh, i only found linux recently. A lot easier to use than i had been led to believe! I tend to assume that most people in here are very new because Ubuntu is such an excellent entry-level distro but many longer term linux-users seem to have moved on to experiment with other ones, out of curiosity or sense of adventure or something. You might like some comments in Bug #1

The answer to your last question then was simply that LiveCd's have to do a much more rigorous and thorough check to find what hardware is attached, an extreme example is the LiveCd of Knoppix and some other trouble-fixing distros.

Thanks, good luck and regards from
Tom :)