Grub booting problems after upgrade to openSUSE 12.2

My son has a multi-boot laptop that would boot Windows Vista, Ubuntu 8.04 LTS,
Fedora 16, and openSUSE 11.1. I decided to install openSUSE 12.2. When
I began installing it, it offered an “upgrade” option, so I thought,
“why not”.

Long story short, everything seemed to install fine, but it fails
in Grub when it tries to boot up.

Trying to boot any of the openSUSE entries displayed by grub results
in the following error:

    Booting 'openSUSE 12.2 - 3.4.6-2.10'

  kernel (hd0)/boot/vmlinuz-3.4.6-2.10-desktop root=/dev/sda8 resume=/dev/disk/by-id/ata/ST9250421AS_5TH04BLR-part6 splash=silent video=1440x900 showopts vga=-x317

  Error 17: Cannot mount selected partition

  Press any key to continue...

Booting Fedora fails with a slightly different error:

    Booting 'Fedora (2.6.25-14.fc9.i686) (/dev/sda7)'

  root (hd0,6)
   Filesystem type is ext2fs. partition type 0x83
  configfile /boot/grub/menu.lst

  Error 15: File not found

  Press any key to continue...

I am still able to boot Ubuntu 8.04 as well as Windows Vista.

Note that this was all these OSes were booting successfully before I
attempted the upgrade to openSUSE 12.2. Note also that none of the
“failsafe” entries in Grub work either.

I try to repair things via the ‘rescue’ option on the openSUSE 12.2
installation DVD, but running /usr/sbin/grub and running

grub> find /boot/grub/stage2
  (hd0,7)
  (hd0,8)
grub> root (hd0,7)              # Also tried w/ (hd0,8); didn't fix!
grub> setup (hd0)

I also trying fixing it on MBR, but ‘root (hd0,0)’ caused an error (something
about unrecognized partition type I think).

Nothing I try seems to work. I am beginning to think that my problem is
that Grub2 is installed to /boot, but that the MBR has version 0.97
or perhaps version 1.5 of Grub installed.

I’m not really sure how to fix this because running

grub --version

from the openSUSE 12.2 ‘rescue’ system from the installation DVD is
version 0.97 and so is the version that I found in /usr/sbin/grub
when I mount the openSUSE 12.2 root file system from the ‘rescue’
system. So, even if I could install a Grub2 in the MBR, I’m not
sure where I would get it from.

I guess, worst case, I could always install openSUSE 12.2 as a NEW
install. Maybe that’s what caused the problems. I’m thinking of
blowing away the Ubuntu install anyhow as it’s ancient and I’m not
too fond of Unity. But if there’s a way to repair things without
going through the installation all over again, I would be most grateful.

Thanks,
-kevin wall
P.S.- If it would be helpful to post the the current menu.lst or a diff
between it and menu.lst.old, let me know. Or any other info that
you might need.

I could always install openSUSE 12.2 as a NEW

That would have been better, way better
You can keep /home as it is if it’s separate

Just run findgrub with option -nc and post the output here. it will show us everything.
-n is for --nocolor because you can not post colors (escape sequences) here.
-c will tell us if the different stage2 and core.img can be found and where there are.

# findgrub -nc

findgrub is included in package updategrub in my repo. The latest version can also be downloaded from unixversal.com.

See this post: http://forums.opensuse.org/english/other-forums/development/programming-scripting/447138-looking-grub-windows-bootloader-all-partitions-17.html#post2481971

We don’t have support fro Grub2 2.0 yet - as in openSUSE 12.2. But it only means that it won’t be able to find the core and will see it as Grub 1.99 it has indeed the same signature. But you don’t have this version of Grub under Ubuntu and Fedora today. So it will be fine. The info about openSuSE 12.2 will just be incomplete.

Here is the output of running this http://www.unixversal.com/linux/openSUSE/findgrub-4.1.tgz
version of findgrub with the ‘-nc’ options, from the openSUSE 12.2 installation DVD ‘Rescue’ system:

Find Grub Version 4.1 - Written for openSUSE Forums

  • reading MBR on disk /dev/sda … → Legacy GRUB found in sda MBR => sda256 0x?? using stage1.5 (openSUSE)

  • searching partition /dev/sda1 (NTFS) … → Windows7/Vista Loader found in /dev/sda1

  • searching partition /dev/sda2 * (NTFS) … → Windows7/Vista Loader found in /dev/sda2

  • reading bootsector /dev/sda3 (Extended) …

  • reading bootsector /dev/sda5 (LINUX) …

  • skipping partition /dev/sda6 (swap)

  • reading bootsector /dev/sda7 (LINUX) …

  • reading bootsector /dev/sda8 (LINUX) …

  • reading bootsector /dev/sda9 (LINUX) …

  • reading bootsector /dev/sda10 (LINUX) …

  • searching partition /dev/sda11 (NTFS) …

  • reading MBR on disk /dev/sdb …

  • skipping partition /dev/sdb1 * (FAT32 Win RE)


WARNING: /boot/grub/device.map not found.
Displayed BIOS device mapping may be incorrect!


Press <enter> to Exit findgrub…

/dev/sda7 is where Fedora 16 is installed
/dev/sda8 is where openSUSE 12.2 is installed.
/dev/sda9 is where Ubuntu 8.04 is installed.

I think that Fedora 16 was the last OS that I had upgraded to prior to trying the
openSUSE 12.2 upgrade.

Thanks,
-kevin

Every time you install a new distro, you install Grub in MBR (in fact this is the default under Fedora and Ubuntu, but not openSUSE). This is why, despite all your distros, you only have a single Grub boot loader in MBR. If you had other Grubs, findgrub would have detected them. See the example below:

# findgrub -nc
Find Grub Version 4.1 - Written for openSUSE Forums

 - reading MBR on disk /dev/sda                       ... --> **Grub2 (1.99) found in sda MBR**     => sda6   0x83 using core (Ubuntu)
 - searching partition /dev/sda1      (FAT16)         ... --> Windows NT/2K/XP Loader found in /dev/sda1

 - skipping partition  /dev/sda2      (FreeBSD)      
 - skipping partition  /dev/sda3      (FreeBSD)      
 - reading bootsector  /dev/sda4   *  (Extended)      ... --> **Legacy GRUB  found in /dev/sda4 **  => sda9   0x83 at offset 582502656 (openSUSE)
                                                                                                => inode: 393986   Path: (hd0)/boot/grub/stage2
 - skipping partition  /dev/sda5      (swap)         
 - reading bootsector  /dev/sda6      (LINUX)         ...
 - reading bootsector  /dev/sda7      (LINUX)         ...
 - reading bootsector  /dev/sda8      (LINUX)         ...
 - reading bootsector  /dev/sda9      (LINUX)         ... --> **Legacy GRUB  found in /dev/sda9  ** => sda9   0x83 at offset 582502656 (openSUSE)
                                                                                                => inode: 393986   Path: (hd0)/boot/grub/stage2
 - reading bootsector  /dev/sda10     (LINUX)         ... --> **Grub2 (1.99) found in /dev/sda10**  => sda9   0x83 at offset 616960472 (openSUSE)
                                                                                                => inode: 394914   Path: (hd0)/boot/grub2/core.img
 - reading bootsector  /dev/sda11     (LINUX)         ... --> **Grub2 (1.99) found in /dev/sda11**  => sda11  0x83 at offset 655821248 (Ubuntu/Mint)
                                                                                                => inode: 1052453  Path: (hd0)/boot/grub/core.img
 - reading bootsector  /dev/sda12     (LINUX)         ...
 - reading bootsector  /dev/sda13     (LINUX)         ... --> **Legacy GRUB  found in /dev/sda13**  => sda13  0x83 at offset 705130602 (Mandriva/ArchLinux/Debian)
                                                                                                => inode: 23920    Path: (hd0)/boot/grub/stage2
 - reading bootsector  /dev/sda14     (LINUX)         ...
 - reading bootsector  /dev/sda15     (LINUX)         ...
 - reading bootsector  /dev/sda16     (LINUX)         ... --> **Legacy GRUB  found in /dev/sda16**  => sda16  0x83 at offset 784242820 (Mandriva/ArchLinux/Debian)
                                                                                                => inode: 15950    Path: (hd0)/boot/grub/stage2
 - reading bootsector  /dev/sda17     (LINUX)         ...

 - reading MBR on disk /dev/sdb                       ... --> **Legacy GRUB  found in sdb MBR**     => sda11  0x83 using stage1.5 (openSUSE)
 - searching partition /dev/sdb1   *  (FAT16)         ... --> Windows NT/2K/XP Loader found in /dev/sdb1

 - skipping partition  /dev/sdb2      (FreeBSD)      
 - skipping partition  /dev/sdb3      (FreeBSD)      
 - reading bootsector  /dev/sdb4      (Extended)      ... --> **Legacy GRUB  found in /dev/sdb4**   => sda9   0x83 at offset 582155312 (openSUSE)
                                                                                                => inode: 394000   Path: (hd0)/boot/grub/stage2.old
 - skipping partition  /dev/sdb5      (swap)         
 - reading bootsector  /dev/sdb6      (LINUX)         ... --> **Legacy GRUB  found in /dev/sdb6**   => sdb6   0x83 at offset 640035343 (Mandriva/ArchLinux/Debian)
                                                                                                => inode: 40185    Path: (hd1)/boot/grub/stage2
 - reading bootsector  /dev/sdb7      (LINUX)         ...
 - reading bootsector  /dev/sdb8      (LINUX)         ...
 - reading bootsector  /dev/sdb9      (LINUX)         ...
 - reading bootsector  /dev/sdb10     (LINUX)         ...
 - reading bootsector  /dev/sdb11     (LINUX)         ...
 - reading bootsector  /dev/sdb12     (LINUX)         ...
 - reading bootsector  /dev/sdb13     (LINUX)         ...


Press <enter> to Exit findgrub...

In the future, while installing Linux distros, always install the Grub boot loader in the root partition - even if it’s going to be installed in the MBR as well (by yourself or by default). There is nothing wrong with having the Grub boot loader installed in several locations.

Your Legacy Grub in MBR is invalid. It should not look like this

  ... --> Legacy  GRUB  found in sda MBR     => sda256  0x?? using stage1.5 (openSUSE)

But rather like this

  ... --> Legacy  GRUB  found in sda MBR     => sda8  0x83 using stage1.5 (openSUSE)

and/or the stage2 it’s looking for is gone.

What I would do in your case:

boot Fedora 16 live CD, open a root terminal and type:

# grub2-install --force /dev/sda7 
# grub2-mkconfig -o /boot/grub2/grub.cfg

I don’t remember what Ubuntu 8.04 used … it’s so old. If it’s Grub2, that would be:


# grub-install --force /dev/sda9 
# update-grub

If it’s legacy grub, that would be :


**# grub**

grub> **find /boot/grub/stage2**
 (hd0,8)

grub> **root (hd0,8)**
 Filesystem type is ext2fs, partition type 0x83

grub> **setup (hd0,8)**
 Checking if "/boot/grub/stage1" exists... yes
 Checking if "/boot/grub/stage2" exists... yes
 Checking if "/boot/grub/e2fs_stage1_5" exists... yes
 Running "embed /boot/grub/e2fs_stage1_5 (hd0,8)"... failed (this is not fatal)
 Running "embed /boot/grub/e2fs_stage1_5 (hd0,8)"... failed (this is not fatal)
 Running "install /boot/grub/stage1 (hd0,8) /boot/grub/stage2 p /boot/grub/menu.lst "... succeeded
Done.

grub> **quit**


Notice that the warnings (in red) are not fatal an normal when you install Grub in a partition boot sector.

Finally reinstall openSUSE. There are different options: using Legacy Grub or Grub2, installing it in MBR or in the extended partition, using generic boot code or not … and I’m sure other people here will have fun discussing them.

Dang! Great help, thanks. A late though. A few minutes after posting it, I realized I could edit entries from grub directly, so I did.
I managed to fix the openSUSE entries. They all were using this:

(hd0)/boot/vmlinuz-…

for the kernel and initrd entries. On a whim, I edited that to remove the ‘(hd0)’ and then booted and it worked.

Probably not the greatest fix, but it worked. From there, once booted up, I ran Boot Loader from Yast and made the same changes.
So rebooting into openSUSE now works.

I’m doing an update now, but once that completes, I’ll run the commands you suggested from openSUSE 12.2. (I assume that will work from there as well as from a Fedora Live boot.)

Once last question, slightly OT for this post. I noticed there is a both PAE and Desktop boot. I have exactly 4GB RAM, so I’m guessing there is no benefit to me to run the PAE version, right? Or does it have other advantages besides being able to access > 4GB RAM on 32 bit systems?

Thanks again to all.
-kevin

One last thing…even after fixing Grub boot loader, I decided to reinstall from scratch (a fresh openSUSE 12.2 install) rather than the upgrade from 11.1 to 12.2 that I originally did. Many things were just not working right so I decided to start over. Although the installation didn’t say, I think the “upgrade” was only intended to be from 12.1 to 12.2 rather than from some earlier version.

-kevin