Grub load fail

Try this: In YaST Boot Loader under the Boot Loader Installation tab, install grub to the “root partition” boot sector. In that same dialog window, go to Options and check the box for “Write Generic Boot Code to MBR”. Make sure the “Set active flag” is also checked. Generic master boot code will chain to the active partition boot sector, which will in turn call grub stage2 (this is the Windows “chain load” method, as opposed to having grub stage1 in the MBR which loads stage2, i.e., the “direct” method).

On a different tack, and just on a hunch, is it possible at all that after the upgrade your system starting seeing the SATA drive as the first drive and the IDE as the second? Take a look at your /etc/fstab - if it is mounting by “device ID” (the new default method which identifies drives by serial number) rather than “device name” (i.e., “/dev/sdb”), the order could have been changed without noticeable effect (except in grub where only device-name is used, which would then fail).

And check the jumpers for the IDE and the DVD (if any), just in case.

And double-check your disk bios settings, too. With your drive, you probably have an LBA or equiv setting needed.

Unfortunately, we can’t be certain exactly how the DVD is doing the boot hand-off. I installed 11.0 on an empty disk, installing grub on the newly created root partition’s boot sector and marking it active, instead of installing grub in the MBR. Worked fine; the generic MBR code which is placed there during partitioning chained to the partition boot sector. The DVD appeared to call the master boot code rather than going directly to the boot sector - when I zeroed out the master boot code in the MBR, the DVD hand-off failed. It may be that the DVD is not chain loading from the MBR but may be using an element in the partition table (which is what the master boot code does) or other logic to get to the boot sector. In other words, the DVD is using the MBR but possibly doing so differently than the master boot code does. We just don’t know.

If you cannot find anything amiss, and the above suggestion re using the generic boot code + partition boot sector doesn’t work either, I would try installing lilo. You don’t have a complicated, multi-booting, changing setup - hence, lilo should do fine. Unlike grub, lilo does not use a pointer and an external loader; everything needed is embedded in the boot record. I’ve seen lilo work where grub would not, with no one knowing the reason why. Before switching, be sure to back up your existing MBR twice, one from YaST and the other from a terminal as root, thus:

#dd if=/dev/sd<x> of=/home/<user>/sd<x>.mbr bs=512 count=1

Because, the MBR contains the partition table, and if that gets borked, nothing will boot the drive. I would also create a grub boot floppy (if you have a floppy drive), very handy.

Ok Mingus725,
you hit something here…

I installed GRUB from YAST using your method (flag and generic method) and 1) Grub still did not load and 2) I could not boot from the DVD / harddrive option !

Then I remembered that I had altered the menu.lst and device.map for the one disk test ! So I went back using the repair option from the DVD, mounted my root partition and edited my device.map and menu.lst to set them as they were when it worked. I re-installed grub.

But now, without the DVD, grub does not load: sits at “GRUB Loading stage2” and with the DVD, it is not booting using the harddrive option anymore ! I am using my portable MAC to write this !

Bottom line:

  • chain loading the loading sequences did something that affected my system a great deal
  • but I cannot boot whatsoever now !

How can I fix the grub from the repair console ?

Ok, I think having bad menu.lst and device.map files caused the issue. I repaired my system using the DVD. It found errors in GRUB, I managed to repair it and it booted again (with the DVD inside as usual). Then I went in YAST/Boot loader and forced the set flag and chaining options. I booted again: no change from before. It does only boot with the DVD inside.

Hargh ! I am getting frustrated even more ! At least my system works.

I am back to square 1 Mingus725 !

How can I fix the grub from the repair console?

Once again, first and foremost, please make a backup of the MBR as described above. Even if the boot code is not working, the MBR still holds the partition table! By far the easiest fix when you got into the un-bootable situation above, would have been to just restore the MBR with dd. Murphy’s Law is real - so have a second MBR backup on separate media (like a floppy) as well as backup boot media (another plug here for making a boot floppy!).

I think at this point I would give lilo a try.

This may help you: SuperGrub boot disk and if you haven’t made one already then do so ASAP. This allows me to now easily recover my similarly not booting dual hard disk 10.0/11.0 computer to at least get the SuSE 10.0 system going.

I’m still no nearer finding a solution either and if you weren’t similarly stuck I’d be thinking my second disk was defect.

Thanks guys, but as I said, I am back to square ONE. I can ONLY boot using the DVD and say “Boot from Harddrive”. And it works ! But if I boot with no disk inside, it sits at “GRUB Loading stage 1.5.”. Weird …

If tests fails and I cannot boot, I can always use the repair option from the DVD and not worry about the MBR.

I don’t want to put too much energy in this. If you guys have an idea, I will be glad to test it.

But for me the 11.0 is worse than 10.3. Period.

I also have SATA drives and Grub would not ‘get it right’. I tried multiple times to no avail. Finally I tried Lilo instead - and no problem. Personally I think Grub has trouble with some SATA drive setups.

Like Mingus725 suggests, try using Lilo instead. It worked for me. Good luck!

Ok guys, I made it !

This was the working combination for me:

  1. specify in the BIOS as the 1st bootable disk, the one that does NOT have the boot partirion (!). In my case /dev/sda
  2. install LILO with in the loader options the /dev/sda disk as the top one in the list
  3. install the GENERIC code in the MBR and activate the boot partition

And it boots with no problem ! Unreal.

I tried all the GRUB configurations !

One weird thing: I installed LILO having my /dev/sdb drive as primary boot drive in the BIOS and at boot it would see the GRUB information ! So i tried to force grub to be install on the MBR of my sda drive but it wouldn’t boot either.

So in the end, I think the boot loader needs to be installed in the MBR of the 1st disk (/dev/sda) regardless where my OS resides. That is very twisted. It may be some food for future GRUB or LILO releases.

Cheers All, thanks for your help. Much appreciated. I almost gave up.

Congratulations!

Just two afterthoughts . . .

The reason I suggested lilo, and probably the reason it worked, is because lilo does not use disk geometries while grub does. When the bios loads, it builds a hardware map that it stores in its CMOS. Grub like many other boot loaders (and partitioning, imaging, and cloning tools) uses the disk geometries as written by the bios. Except that sometimes there is a problem doing that. Lilo does not use the map.

Also just fyi, unless the system is booting from a volume boot record - typically a floppy or bootable optical media - there must be code in the MBR. The “generic” code that YaST will write there is just like many another. The code is located in the first sector of the disk, the bios is hard-coded to call that code; generic code will scan the partition table for the active primary and chain to the boot sector on that partition, transfering execution to that code. Grub can be installed in the MBR to behave this way, but it’s primary design is to bypass the partition boot sector, so it goes straight from MBR to the loader (in grub’s case, /boot/grub/stage2). Lilo’s loader is installed with it, so there is no chaining or branching at all; the main drawback of lilo is that if the disk or boot configuration needs to be changed, whereas that can be done with grub by editing device.map and/or menu.lst, lilo must be re-installed.

Ok, I got that.
Still for my configuration GRUB is not working as it should. If I specify the sdb as primary boot device in the BIOS and install GRUB on it, the system will not boot on its own !
LILO seems to install itself on the sda and I have to use this one as the primary boot device in the BIOS. I tried to do the same with GRUB but failed …

Thanks for all your comments and insight info.

Other inssues I have with my 11.0 X64 are:

  • java does not work properly or not all all with my browsers
  • my USB webcam (MICROSOFT VX3000) driver is not very good and the image sucks
  • I am having issues with my sound recording pitch from the microphone: I sound like DRACULA on skype !
  • Miro used to work flawlessly with 10.3. now I cannot play videos correctly with xine or gstreamer. I have to resort to wathc videos outside of miro with mplayer …

Let me know if you have any idea or links.

Cheers.

I would think that you could install lilo on whichever drive you wish, as long as you have the config alignment correct (so the pointer is right). Again, the distinguishing characteristics of lilo vis-a-vis grub is lilo’s embedding (as opposed to chaining) and its not using the bios map.

Re Java: Getting all the right versions of Java installed and the pointers right can be a pain; there are a lot more than you might think. As root do

#update-alternatives --display java

and you will see all the pointers, which versions of Java are being looked for (may not be what you have installed now), and which is the “best” version. I needed to run update-alternatives to re-set the pointers after I upgraded, as I had to do a couple of times after prev upgrades. Find where the primary java engine is on your system. On my x64 it’s at:

/usr/lib/jvm/java-1.6.0-sun-1.6.0.u6/jre/bin/java

I’m using the 586 version of Firefox with 586 java, because it’s IMO a simpler method of getting the java plugin working with FF; this is using Sun’s plugin which only comes as 32-bit. Alternatively, there is an open-source engine (the “openjdk” and “icedtea” vsns) which has a 64-bit plugin which will work with FF 64-bit (if you go this route, stick with openjdk; icedtea is not fully baked). Same for Seamonkey as FF. Konqueror doesn’t use a plugin; it calls the java engine directly. You just need to give Konq the correct path in its Java config. I don’t use Opera anymore, don’t remember how it config’s java.

Re Miro: I stopped using it, but remember it was a bit difficult getting set up. The package is from Packman; sometimes Packman’s packages don’t resolve all the dependencies. Run Miro from a terminal and it may throw errors that point you to where the problem is.

Are you using KDE 4? My install had gstreamer set up as the default phonon (the new multi-media framework) audio backend. Didn’t work (it is KDE 4 after all), didn’t want to bother with why. Installed the phonon-backend-xine package and in the KDE sound config switched the phonon backend to xine. And of course, using Packman’s libxine. All is fine now.

Hope that helps. There are virtually always solutions, although can be frustrating to find them. Good luck.

Ok, here I am again with the same problem. This time, I kept only my SATA drive (/dev/sda) on the 4th master of my MB. And GRUB will saty stuck in stage 2 unless I boot from the DVD …

I tried to install LILO like last time but it fails with this message:

LILO version 22.8, Copyright (C) 1992-1998 Werner Almesberger
Development beyond version 21 Copyright (C) 1999-2006 John Coffman
Released 19-Feb-2007 and compiled at 11:12:39 on Dec 3 2008
Running Linux kernel 2.6.27.7-9-default on x86_64

raid_setup returns offset = 00000000 ndisk = 0
BIOS VolumeID Device
Reading boot sector from /dev/disk/by-id/ata-ST3320620AS_5QF4CLDP-part2
pf_hard_disk_scan: ndevs=1
0800 00041486 /dev/sda
device codes (user assigned pf) = 0
device codes (user assigned) = 0
device codes (BIOS assigned) = 0
device codes (canonical) = 1
Warning: Device 0x0800: Inconsistent partition table, 2nd entry
CHS address in PT: 278:90:1 –> LBA (4471740)
LBA address in PT: 4209030 –> CHS (262:0:1)
Fatal: Either FIX-TABLE or IGNORE-TABLE must be specified
If not sure, first try IGNORE-TABLE (-P ignore)

What do you think is happening ?

Grrr! :frowning:

What do you mean by the SATA being “on the 4th master”? There is no “master” for SATA, just ports. And by the way, is that 4th by label printed on the mobo or 4th as listed by the bios - and have you checked that 4th on mobo is same as 4th in bios?

Post back output of:

fdisk -lu

Lilo is reporting a partition table error. Check in your bios for your disk configuration settings; you should have a setting for LBA (alternatively it could say Large, or Auto - make it LBA). And how old is this bios?

Then do:


dd if=/dev/sda of=sdambr bs=512 count=1
xxd sdambr

Post back output of last command.

What is the mobo make and model?

Sorry, I was precise enough in my post. I have a MB with four ports: two IDE and two SATA. The Bios labels the SATA I have my disk on as “4th master”. That’s all.
It’s a western digital 300Gb with three partitions (swap (sda1), / (*sda2) and /home (sda3)).
I will post the scripts results tomorrow.
GRUB installs fine (no errors) at the opposite of LILO but I cannot boot without the DVD in the drive and use the “boot from harddrive” option. Since I had the same problem in the past and you helped me, I tried the same tricks, no luck …

Could the MBR of a disk be write protected ?

I don’t see how the MBR could be write-protected - code needs to write to it all the time (partition table, boot flag, disk signature where W$ keeps its drive-letter cross-ref, etc.).

Have you tried switching the drive to the other SATA port?

The LILO error is indicating a problem in the 2nd record in the partition table, which is why I asked to look at it. There could be a problem with the LBA calculation or bad bits being passed by the bios.

After you post back I’ll review what we did the last time and see if we can try a few new tricks.

My other SATA connector is broken, no luck there …

fdisk -lu

Disk /dev/sda: 320.0 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders, total 625142448 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x00041486

Device Boot Start End Blocks Id System
/dev/sda1 63 4209029 2104483+ 82 Linux swap / Solaris
/dev/sda2 * 4209030 46154744 20972857+ 83 Linux
/dev/sda3 46154745 625137344 289491300 83 Linux

dd if=/dev/sda of=sdambr bs=512 count=1
xxd sdambr

0000000: 31c0 8ed0 bc00 7c8e c08e d8bf 1e06 be1e 1…|…
0000010: 7c50 57b9 e201 f3a4 b900 02f3 abcb 80fa |PW…
0000020: 8f7e 02b2 8052 52bb 9407 8daf 2a00 8a46 .~…RR…*…F
0000030: 0466 8b7e 0866 033e b306 84c0 740b 807e .f.~.f.>…t…~
0000040: 0080 7505 6689 3e84 0b83 c510 83c3 0980 …u.f.>…
0000050: fbb8 75da b8e1 00c1 e002 89c6 668b ac00 …u…f…
0000060: 0866 85ed 7519 b8c5 06be bb06 e8a5 0089 .f…u…
0000070: c6e8 9a00 5a31 c0cd 13cd 18fb f4eb fc66 …Z1…f
0000080: 892e b306 beab 06b4 425a 52cd 13b8 d906 …BZR…
0000090: 72d7 a000 7c84 c074 03a1 fe7d 3d55 aab8 r…|…t…}=U…
00000a0: e906 75c5 6689 ee5a e955 7510 0001 0000 …u.f…Z.Uu…
00000b0: 7c00 0000 0000 0000 0000 0045 7272 6f72 |…Error
00000c0: 2000 0d0a 004e 6f20 6163 7469 7665 2070 …No active p
00000d0: 6172 7469 7469 6f6e 0044 6973 6b20 7265 artition.Disk re
00000e0: 6164 2065 7272 6f72 004e 6f20 6f70 6572 ad error.No oper
00000f0: 6174 696e 6720 7379 7374 656d 0049 6e76 ating system.Inv
0000100: 616c 6964 2043 4853 2072 6561 6400 e803 alid CHS read…
0000110: 00be c206 60ac b40e bb01 00cd 10ac 84c0 …`…
0000120: 75f4 61c3 0000 0000 0000 0000 0000 0000 u.a…
0000130: 0000 0000 0000 0000 0000 0000 0000 0000 …
0000140: 0000 0000 0000 0000 0000 0000 0000 0000 …
0000150: 0000 0000 0000 0000 0000 0000 0000 0000 …
0000160: 0000 0000 0000 0000 0000 0000 0000 0000 …
0000170: 0000 0000 0000 0000 0000 0000 0000 0000 …
0000180: 0000 0000 0000 0000 0000 0000 0000 0000 …
0000190: 1c80 b600 0000 0000 0000 0000 0000 0000 …
00001a0: 0000 0000 0000 0000 0000 0000 0000 0000 …
00001b0: 0000 0000 0000 0000 8614 0400 0000 0001 …
00001c0: 0100 82fe 7f05 3f00 0000 4739 4000 805a …?..G9@…Z
00001d0: 4116 83fe ffff 8639 4000 730a 8002 00fe A…9@.s…
00001e0: ffff 83fe ffff f943 c002 c892 8222 0000 …C…"…
00001f0: 0000 0000 0000 0000 0000 0000 0000 55aa …U.

You have the so-called “generic boot code” in your MBR that openSUSE will optionally install (this is actually the old DOS code, nearly identical to XP & Vista’s). sda2 has its boot flag set in the table, making it the “active” primary.

Let’s take a look at the sda2 boot sector:

dd if=/dev/sda2 of=pbrsda2 bs=512 count=1
xxd pbrsda2

I notice your fdisk is now reporting 1 disk, not 2 as the last time around. And looks like what was sdb is now sda. Are we dealing with only one disk now?

Also, what is the machine? Some machines (like Thinkpads) do proprietary weirdness with the sectors.

machine is a desktop: hp pavilion a1310n, old clunker …
Only one disk now, I thought having the two disk was getting me into trouble. Last time the MBR was on sdb, now I only have sda.

Here is the xxd dump:

0000000: eb48 9000 0000 0000 0000 0000 0000 0000 .H…
0000010: 0000 0000 0000 0000 0000 0000 0000 0000 …
0000020: 0000 0000 0000 0000 0000 0000 0000 0000 …
0000030: 0000 0000 0000 0000 0000 0000 0000 0302 …
0000040: ff01 0080 66fa f300 0008 fa90 90f6 c280 …f…
0000050: 7502 b280 ea59 7c00 0031 c08e d88e d0bc u…Y|…1…
0000060: 0020 fba0 407c 3cff 7402 88c2 52be 817d . …@|<.t…R…}
0000070: e836 01f6 c280 7456 b441 bbaa 55cd 135a .6…tV.A…U…Z
0000080: 5272 4b81 fb55 aa75 45a0 417c 84c0 783e RrK…U.uE.A|…x>
0000090: 7505 83e1 0174 3766 8b4c 10be 057c c644 u…t7f.L…|.D
00000a0: ff01 668b 1e44 7cc7 0410 00c7 4402 0100 …f…D|…D…
00000b0: 6689 5c08 c744 0600 7066 31c0 8944 0466 f...D…pf1…D.f
00000c0: 8944 0cb4 42cd 1372 05bb 0070 eb7d b408 .D…B…r…p.}…
00000d0: cd13 730a f6c2 800f 84e8 00e9 8d00 be05 …s…
00000e0: 7cc6 44ff 0066 31c0 88f0 4066 8944 0431 |.D…f1…@f.D.1
00000f0: d288 cac1 e202 88e8 88f4 4089 4408 31c0 …@.D.1.
0000100: 88d0 c0e8 0266 8904 66a1 447c 6631 d266 …f…f.D|f1.f
0000110: f734 8854 0a66 31d2 66f7 7404 8854 0b89 .4.T.f1.f.t…T…
0000120: 440c 3b44 087d 3c8a 540d c0e2 068a 4c0a D.;D.}<.T…L.
0000130: fec1 08d1 8a6c 0c5a 8a74 0bbb 0070 8ec3 …l.Z.t…p…
0000140: 31db b801 02cd 1372 2a8c c38e 0648 7c60 1…r*…H|`
0000150: 1eb9 0001 8edb 31f6 31ff fcf3 a51f 61ff …1.1…a.
0000160: 2642 7cbe 877d e840 00eb 0ebe 8c7d e838 &B|…}.@…}.8
0000170: 00eb 06be 967d e830 00be 9b7d e82a 00eb …}.0…}.*…
0000180: fe47 5255 4220 0047 656f 6d00 4861 7264 .GRUB .Geom.Hard
0000190: 2044 6973 6b00 5265 6164 0020 4572 726f Disk.Read. Erro
00001a0: 7200 bb01 00b4 0ecd 10ac 3c00 75f4 c300 r…<.u…
00001b0: 0000 0000 0000 0000 0000 0000 0000 0000 …
00001c0: 0000 0000 0000 0000 0000 0000 0000 0000 …
00001d0: 0000 0000 0000 0000 0000 0000 0000 0000 …
00001e0: 0000 0000 0000 0000 0000 0000 0000 0000 …
00001f0: 0000 0000 0000 0000 0000 0000 0000 55aa …U.