Grub gone wrong!

re-topic/thread title from: openSUSE Forums - View Single Post - Repair/rescue in 11.2 LiveCD??

I had MsWinXP on the 300gb drive (sda here), then installed 11.1 to the 120gb (sdb)
They lived together happily with openSuse grub menu working fine and dual booting.

I then installed 11.2 on to the 300Gb, leaving windows where it was and only sharing the swapfile on the 120Gb. All was fine, and triple boot available, 11.2’s grub menu would appear first, if I wanted 11.1 I selected it, then the old 11.1 grub menu would appear. Yesterday I booted MsWin for the first time since installing 11.2.
Now, I boot and get the 11.2 grub menu, but if I select ANYTHING other than 11.2, MsWinXP starts…

Here are the infos:



Disk /dev/sda: 300.1 GB, 300090728448 bytes
255 heads, 63 sectors/track, 36483 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x6bf99939

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        4653    37375191    7  HPFS/NTFS
/dev/sda2            4654       17402   102406342+   7  HPFS/NTFS
/dev/sda3           17403       36483   153268132+   f  W95 Ext'd (LBA)
/dev/sda5           17403       20013    20972826   83  Linux
/dev/sda6           20014       36483   132295243+  83  Linux

Disk /dev/sdb: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x2a4e2a4d

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb3   *        2624       14593    96149025    f  W95 Ext'd (LBA)
/dev/sdb5            2624        2885     2104483+  82  Linux swap / Solaris
/dev/sdb6            2886        5496    20972826   83  Linux
/dev/sdb7            5497       14593    73071621   83  Linux





~> sudo cat /boot/grub/menu.lst
root's password:                                  
# Modified by YaST2. Last modification on Wed Nov 18 23:49:41 GMT 2009
# THIS FILE WILL BE PARTIALLY OVERWRITTEN by perl-Bootloader          
# Configure custom boot parameters for updated kernels in /etc/sysconfig/bootloader

default 0
timeout 8
gfxmenu (hd1,4)/boot/message

###Don't change this comment - YaST2 identifier: Original name: linux###
title openSUSE 11.2                                                     
    root (hd1,4)                                                        
    kernel /boot/vmlinuz-2.6.31.5-0.1-default root=/dev/disk/by-id/ata-Maxtor_7L300S0_L60LCJ0G-part5 resume=/dev/disk/by-id/ata-ST3120022A_5JT3CL13-part5 splash=silent quiet showopts vga=0x348      
    initrd /boot/initrd-2.6.31.5-0.1-default                                                       

###Don't change this comment - YaST2 identifier: Original name:  openSUSE 11.1 - 2.6.27.37-0.1 (pae) (/dev/sdb6)###                                                                                   
title  openSUSE 11.1 - 2.6.27.37-0.1 (pae) (/dev/sdb6)                                             
    root (hd0,5)                                                                                   
    configfile /boot/grub/menu.lst                                                                 

###Don't change this comment - YaST2 identifier: Original name: windows 1###
title windows 1                                                             
    map (hd1) (hd0)                                                         
    map (hd0) (hd1)                                                         
    rootnoverify (hd1,0)                                                    
    makeactive                                                              
    chainloader +1                                                          

###Don't change this comment - YaST2 identifier: Original name: windows 2###
title windows 2                                                             
    map (hd1) (hd0)
    map (hd0) (hd1)
    rootnoverify (hd1,1)
    makeactive
    chainloader +1

###Don't change this comment - YaST2 identifier: Original name: failsafe###
title Failsafe -- openSUSE 11.2
    root (hd1,4)
    kernel /boot/vmlinuz-2.6.31.5-0.1-default root=/dev/disk/by-id/ata-Maxtor_7L300S0_L60LCJ0G-part5 showopts apm=off noresume nosmp maxcpus=0 edd=off powersaved=off nohz=off highres=off processor.max_cstate=1  x11failsafe vga=0x348
    initrd /boot/initrd-2.6.31.5-0.1-default

###Don't change this comment - YaST2 identifier: Original name: memtest86###
title Memory Test
    kernel (hd1,4)/boot/memtest.bin

###Don't change this comment - YaST2 identifier: Original name: linux###
title Kernel-2.6.31.5-0.1-default
    root (hd1,4)
    kernel /boot/vmlinuz-2.6.31.5-0.1-default root=/dev/disk/by-id/ata-Maxtor_7L300S0_L60LCJ0G-part5 resume=/dev/disk/by-id/ata-ST3120022A_5JT3CL13-part5 splash=silent quiet showopts vga=0x348
    initrd /boot/initrd-2.6.31.5-0.1-default

Confuseling has kindly made some suggestions in the original thread.

Did you try putting the boot flag back on sdb6 ?

Yes Caf, tried that!

Disk /dev/sda: 300.1 GB, 300090728448 bytes
255 heads, 63 sectors/track, 36483 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x6bf99939

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        4653    37375191    7  HPFS/NTFS
/dev/sda2            4654       17402   102406342+   7  HPFS/NTFS
/dev/sda3           17403       36483   153268132+   f  W95 Ext'd (LBA)
/dev/sda5           17403       20013    20972826   83  Linux
/dev/sda6           20014       36483   132295243+  83  Linux

Disk /dev/sdb: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x2a4e2a4d

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb3            2624       14593    96149025    f  W95 Ext'd (LBA)
/dev/sdb5            2624        2885     2104483+  82  Linux swap / Solaris
/dev/sdb6   *        2886        5496    20972826   83  Linux
/dev/sdb7            5497       14593    73071621   83  Linux

You could just work from yast in 11.2 in the bootloader section and re-do it all.
But where is the first section to sdb

Tell you what - I have been testing grub2 in a sandbox. It is way better and setting up other OS’s

Oh well… I tried, got the tar.gz etc autogen.sh .configure, etc etc etc…
But once installed I could not get it to do anything…
grub-install > not allowed by YAST “use grub-install-unsupported”
grub-probe… nada happened.
Trouble distinguishing between commands in grub (“legacy”) and grub2, have to add --version to all (and look at result!)

Do I have to uninstall grub (the app) first?

Anyway all this should not be at all necessary. If the liveCD could automagically generate a working boot sequence on install, why can’t it do it again??
One problem is that I am an idiot and am not really sure what grub was doing before it stopped doing it. My hazy understanding is this:
When I installed 11.1 to run alongside MswinXP, it put a pointer in the MBR of the first boot disk (winXP) telling it to look in second disk /boot, and load the menu, then when menu item is selected loads appropriate…

Now having installed 11.2 grub, overwrites the instruction in MBR now telling it to point to ITS menu.
What I don’t understand is why this would suddenly stop working. As I say above the probs started when I ran MSWinXP, on reboot, no more 11.1!!
I could understand if winXP had decided to rewrite MBR, but then I would not be able to boot 11.2 at all?
I have tried YAST bootmanager, but does not seem to help/do anything
I also tried autosupergrub from within Windows, it wanted some DOS FDISK to be done, so I backed out…
Should I try supergrub on a USB key?

I’m not sure what you have been doing. Do you mean you tried grub2?
I wasn’t really suggesting you do.

Anyway. How about using Parted Magic to put the boot flag on sda to sda3

Re-doing grub from a live cd, parted magic will do - follow this:

From a terminal:

You enter this ---------------- grub Computer returns like this ---- grub>
You enter this ---------------- find /boot/grub/menu.lst
Computer returns like this ---- (hd0,5)
Here, (hd0,5) is Grub’s pointer to my openSUSE installation. Your pointer will be different from my example (hd0,5). Substitute your values for my example (hd0,5). Now that you have the pointer, proceed like this:
You enter this ---------------- root (hd0,5)
Computer returns like this ---- Filesystem type is ext2fs, partition type 0x83
You enter this ---------------- setup (hd0)
You see several lines like this — Checking if /boot/grub/stage1 exists … yes Computer finally returns this-- Succeeded…Done
You enter this ---------------- quit
You enter this ---------------- reboot

From the original thread

The suggestion (same as what caf is saying) is to install grub onto the root partition of your 11.1 install, then use the 11.2 grub to chainload that.

That must have been essentially the setup you had originally, as you said you were seeing two grub menus.

It will not affect your 11.2 / Windows boot at all - you are installing to the other disk, and the bios decides which disk has priority.

Sorry - small correction. Caf is suggesting you install to the MBR of the target drive, rather than the root partition (setup (hd0), as opposed to setup (hd0,5)). Either would work.

The key point is it won’t matter as far as your present boot goes.

Your BIOS is set to boot sda (or hd1 as grub calls it - the naming corresponds to /boot/grub/device.map).

sda has 11.2’s grub on it - probably on its MBR. That loads, and then loads SUSE 11.2, or passes the boot control to Windows’ bootloader or 11.1’s bootloader (in theory - that stopped working).

Reinstalling 11.1’s bootloader anywhere on sdb will not change the earlier part of the process, which is determined entirely by the bios and the contents of sda.

What is odd about this is your grub is/was working wasn’t it. It was just the point where you select the other entries that didn’t work.
Looking at the entries they seem correct.

Darn, wish I could just get me hands on it. I’d have it fixed in a jiffy.

Did anything happen when you booted windows the first time?

Not that I noticed Caf, I can’t remember; I presumed it was a perfectly ordinary thing to do. Knowing how long WinXP takes to boot and become usable I may well have gone to make tea etc, and missed some important message, but… not that I know of…

So what is the situation now?

**** **** ****! = (darn fooey & pshaw) I wrote a long paragraph as an edit…
took too long & timed out… d’oh!
I have lots of distractions today. :slight_smile:

Sorry for multi-posting in the same thread, but the edit time-out means I have to start again >:(
When the problem started I thought I would boot from my LiveCD from my USB keydrive and do a “repair”. It turns out that there is no “repair” option on the Live CD (Why Not???)
Booting to the USB meant I had to change the boot order in BIOS. (this is AFTER the problem arose)
So this morning I tried changing the boot order in BIOS to boot first from the Maxtor 300Gb drive… Interesting, and frankly weird (to me) results:

(from scribbled notes)

I got a mono grub menu, ie no suse green branding.
The menu is the 11.2 menu.lst
Selecting 11.2 default > result:
FS type Unknown partition 0x82
Select 11.1 > result:
fstype ext2fs partition 0x83 configfile /boot/grubmenu.lst file not found
ERR 15

Select Windows 1 result:
map (hd1) (hd0)
map (hd0) (hd1)
rootnoverify (hd1,0)
make active
ERROR 12 invalid drive (can’t read my own scribble here d’oh!) req or something.
Windows 2 I did not bother because I know it points to a NTFS partition only containing stuff

try Super Grub Disk

You can repair Grub from a live cd but you need to use su terminal. You need to put the HD’s back the way they were.

From here again: Grub gone wrong! - openSUSE Forums
When you do
find /boot/grub/menu.lst
You should find 2 entries because there is one for 11.1 and 11.2

You want the entry for (hd0,4) (I think it’s 4)

It will re-install the 11.2 to the MBR
You will then need to add the entries manually for 11.1 once you get in to 11.2 again.

Caf thank-you for staying with me on this, & you Palladium, & others…
The fact is that this is not HUGELY important, I have 11.2 working, and three copies of my old /home/stephen directory. If 11.1 disappears it would take with it my girlfriend’s /home/ settings (also backed up and available) and my ./cx crossover settings. But I am interested and want to know what happened and how to get it back, in case it happens again when more is at stake.
I am busy, tired and slightly drunk now, I will have another crack at it in the morning.

Thanks again all of you…
xxxxxxx.

This is driving me mental!
I took a couple of days off.
I have tried:

  1. LiveCD (The one I originally installed 11.2, on USB) > No repair option
  2. openSUSE-11.2-NET-i586.iso (Also USB)>Asks me to insert CD1 (?)
  3. Supergrub > seemed not to change anything (?)
  4. AutoSuperGrub (From Within WinXP) > on reboot, info flies off of screen, seemed to want me to use DOS Fdisk, I backed out not wanting to break my openSuse installs with DOS tools.
  5. YAST from 11.2 >Did not seem to help
  6. grub manually from a runlevel3 terminal as per Confuseling’s advice here: openSUSE Forums - View Single Post - Repair/rescue in 11.2 LiveCD?? >
  7. Grub2> Just playing with it really, it compiled and installed but I could not get it to work, from memory grub-install and grub-probe…

Here again is output from fdisk -l and cat /boot/grub/menu.lst

Disk /dev/sda: 300.1 GB, 300090728448 bytes
255 heads, 63 sectors/track, 36483 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x6bf99939                     

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        4653    37375191    7  HPFS/NTFS
/dev/sda2            4654       17402   102406342+   7  HPFS/NTFS
/dev/sda3           17403       36483   153268132+   f  W95 Ext'd (LBA)
/dev/sda5           17403       20013    20972826   83  Linux          
/dev/sda6           20014       36483   132295243+  83  Linux

Disk /dev/sdb: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x2a4e2a4d

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb3            2624       14593    96149025    f  W95 Ext'd (LBA)
/dev/sdb5            2624        2885     2104483+  82  Linux swap / Solaris
/dev/sdb6   *        2886        5496    20972826   83  Linux
/dev/sdb7            5497       14593    73071621   83  Linux

~> cat /boot/grub/menu.lst                                     
# Modified by YaST2. Last modification on Wed Nov 18 23:49:41 GMT 2009      
# THIS FILE WILL BE PARTIALLY OVERWRITTEN by perl-Bootloader                                                                                           
# Configure custom boot parameters for updated kernels in /etc/sysconfig/bootloader                                                                    

default 0                                                                                                                                              
timeout 8                                                                                                                                              
gfxmenu (hd1,4)/boot/message                                                                                                                           
                                                                                                                                                       
###Don't change this comment - YaST2 identifier: Original name: linux###                                                                               
title openSUSE 11.2                                                                                                                                    
    root (hd1,4)                                                                                                                                       
    kernel /boot/vmlinuz-2.6.31.5-0.1-default root=/dev/disk/by-id/ata-Maxtor_7L300S0_L60LCJ0G-part5 resume=/dev/disk/by-id/ata-ST3120022A_5JT3CL13-part5 splash=silent quiet showopts vga=0x348                                                                                                              
    initrd /boot/initrd-2.6.31.5-0.1-default                                                                                                           
                                                                                                                                                       
###Don't change this comment - YaST2 identifier: Original name:  openSUSE 11.1 - 2.6.27.37-0.1 (pae) (/dev/sdb6)###                                    
title  openSUSE 11.1 - 2.6.27.37-0.1 (pae) (/dev/sdb6)                                                                                                 
    root (hd0,5)                                                                                                                                       
    configfile /boot/grub/menu.lst                                                                                                                     

###Don't change this comment - YaST2 identifier: Original name: windows 1###
title windows 1                                                             
    map (hd1) (hd0)                                                         
    map (hd0) (hd1)
    rootnoverify (hd1,0)
    makeactive
    chainloader +1

###Don't change this comment - YaST2 identifier: Original name: windows 2###
title windows 2
    map (hd1) (hd0)
    map (hd0) (hd1)
    rootnoverify (hd1,1)
    makeactive
    chainloader +1

###Don't change this comment - YaST2 identifier: Original name: failsafe###
title Failsafe -- openSUSE 11.2
    root (hd1,4)
    kernel /boot/vmlinuz-2.6.31.5-0.1-default root=/dev/disk/by-id/ata-Maxtor_7L300S0_L60LCJ0G-part5 showopts apm=off noresume nosmp maxcpus=0 edd=off powersaved=off nohz=off highres=off processor.max_cstate=1  x11failsafe vga=0x348
    initrd /boot/initrd-2.6.31.5-0.1-default

###Don't change this comment - YaST2 identifier: Original name: memtest86###
title Memory Test
    kernel (hd1,4)/boot/memtest.bin

###Don't change this comment - YaST2 identifier: Original name: linux###
title Kernel-2.6.31.5-0.1-default
    root (hd1,4)
    kernel /boot/vmlinuz-2.6.31.5-0.1-default root=/dev/disk/by-id/ata-Maxtor_7L300S0_L60LCJ0G-part5 resume=/dev/disk/by-id/ata-ST3120022A_5JT3CL13-part5 splash=silent quiet showopts vga=0x348
    initrd /boot/initrd-2.6.31.5-0.1-default

My main problem in trying to learn how to do this, is that Idon’t know what grub is doing at the moment, what is WAS doing before or what I want it to do.
Grub takes its disk id from the bios???
So hd0 is the first boot disk??
What about when I boot from USB? there is no boot order for grub to read???

ps. just tried KGrubeditor… No help there either!

You said:
I then installed 11.2 on to the 300Gb
Which is sda isn’t it

But menu.lst says:
title openSUSE 11.2
root (hd1,4)
So shouldn’t it be

title openSUSE 11.2
root (hd0,4)

What happened to sdb1 and 2?

I “THINK” sdb1 and sdb2 were partitions I put on to the 120Gb drive when setting up and getting ready to use 11.1. IIRC one was a FAT32 partition and the other was ext3, I put them there to store the .iso for the 11.1 install, plus guides, instructions etc, that I could refer to and access. Once I had installed, and had ntfs-3g working and had edited my 11.1 fstab to make my Windows drive accessible, I deleted them, as I knew I would need some space soon (lol, the plan was to make enough space on the 120Gb to clone my WinXP install, then delete it from the 300Gb, expand my 11.2 partitions to use all of the 300Gb space, and adjust grub to see the new set-up)
As for your first question, my poor old brain believes that ATM:

Windows is on sda1 which is I think (hd1) ie second in the BIOS. 11.2 is on sda5 (hd1,4) ???
11.1 is on sdb6 (hd0) ???