opensuse 11.4 Grub / MBR error

Hi all, i have opensuse 11.4 and everything has been running great the last 6 months. I restarted last night and I received the following message

GNU GRUB version …
[Minimal BASH-like line editing is suported. For the first word, TAB lists possible command completions. Anywhere else TAB lists the possible completions of a device/filename]
grub> _

Then the fun began. I’ve tried all of the following and have yet to fix the problem.

  1. managed to boot into opensuse by using a opensuse 12.1 live cd. i followed the instructions shown here
    http://opensuse.swerdna.org/susebootfive.html#bootinstalled
    to try to install a new bootloader. However when i “Then click Finish to save the changes and install the reconfigured Grub into the hard drive’s MBR. …” i get an error message :

grub error 17 cannot mount selected partition
grub> quit

  1. ive also tried the suggestion given here
    http://forums.opensuse.org/english/get-technical-help-here/install-boot-login/407469-repair-boot-loader.html
    but no luck =(

  2. Ive also tried the suggestion here
    http://forums.opensuse.org/new-user-how-faq-read-only/unreviewed-how-faq/429971-re-install-grub-quickly-parted-magic.html#post2097786
    For some reason, when i try to find the file menu.lst its not there!!? does menu.lst exist ???

Thanks in advance.
Phil

You should look for /boot/grub/stage2, NOT /boot/grub/menu.lst.

Once you have found stage2, you can apply the method described there.

I don’t know why people insist of looking for menu.lst.
I already told @caf4926 to change that.

Based on this info: Grub error 17 : Cannot mount selected partition; This error is returned if the partition requested exists, but the filesystem type cannot be recognized by GRUB. It sounds like the root partition, where openSUSE is installed has went bad for some reason. You most likely will need to do a clean install, do a custom partition, elect to mount all existing partitions as created before, except you will format the root / partition and you WILL NOT format the /home partition and only mount it. Thus keeping all personnel settings and requiring only that you reinstall your old applications again. If the disk is really bad, then the reinstall will not work either. As for grub menu.lst, its located in /boot/grub/menu.lst, but if you can mount it because of error 17, you will not be able to find it with a LiveCD I would fear. You could consider downloading and creating a GParted disk perhaps, then see if it could possible fix the / root partition first, but I have not had all that good a luck with such a fix. Perhaps a lot more information on your computer and hard disk in question could be helpful.

Thank You,

But rather than reinstalling Grub, I would first try to boot from the Grub shell. Here’s an example. You won’t probably see (hd0,9) but something else.

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

grub> **root (hd0,9)**
Filesystem type is ext2fa, partition type 0x83

grub> **kernel /boot/vmlinuz**
    [Linuz-bzImage, setup=0x4200, size=0x4baef0]

grub> **initrd /boot/initrd**
    [Linux-initrd @ 0x37478000, 0xb77706 bytes]

grub> **boot**

It also sounds like the OP followed a bad or inappropriate advice, since it got this error afterwards. The situation he had before (the Grub shell) was better. I would say that maybe only the menu was missing - which is not fatal. Now he should boot from liveCD, look for stage2 and reinstall stage1 wherever (MBR or active partition) so that it will look for stage2 at the right place.

So a repair is possible if the partition is not at fault and of course we depend so much for those clues from what the OP says. However, if I got such an error on boot, I would not think twice on doing a reload and dumping the hard disk at any other sign of a problem. But, I have had power failure induced problems that were easy to fix by redoing the partition. And trying to save it was often not worth the effort. But, if you have but one system to depend on, it might be a different story of course, but few fixed partitions ever worked properly without a full re-installation.

Thank You,

please_try_again,
thanks for the help. ive tried to find stage2 within the grub folder with the code that you showed above

“grub> find /boot/grub/stage2”

but i continue to receive the following msg

" Error 15: File not found"

I tried the above in the following two different ways :

  1. after a reboot where I received

GNU GRUB version …
[Minimal BASH-like line editing is suported. For the first word, TAB lists possible command completions. Anywhere else TAB lists the possible completions of a device/filename]
grub> _

  1. after i used a live CD to get to the opensuse OS
    Ive verified that the file, stage2, is indeed under /boot/grub by using a terminal window.

So at the present time, I havent been able to boot from the Grub shell using the commands you listed above ( i havent been able to proceed beyond line one). Any other advise?

thanks.

Hi jdmcdaniel3,
Thanks for the advice. Im going to see if i can resolve this problem without having to do a new install first. im a little hesitant to do that at this time. ive got my fingers crossed… thanks!

Do a file system check (fsck) and reinstall Grub following @caf4926’s tutorial, but looking for stage2 rather than menu.lst. By the way, do you see /boot/grub/menu.lst too? If so, how does it look like?

First thing to do - as always - is to boot from Live CD, open a terminal, type the following command and post the output here:

su -l
fdisk -l

Then we might be able to tell you where to look and what to do.

Hi please_try_again,
sorry about that. first time posting in the forums. OK, so i booted from the live cd, and retrieved the following information

*linux:/home/linux # su -l
linux:~ # fdisk -l

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x870de61e

Device Boot Start End Blocks Id System
/dev/sda1 2048 1024002047 512000000 83 Linux
/dev/sda2 1024015230 1912538249 444261510 f W95 Ext’d (LBA)
/dev/sda3 * 1912538250 1953503999 20482875 83 Linux
/dev/sda5 1024017278 1107903357 41943040 83 Linux
/dev/sda6 1107905406 1114196861 3145728 83 Linux
/dev/sda7 1114198910 1181307773 33554432 82 Linux swap / Solaris
/dev/sda8 1181309822 1912538249 365614214 83 Linux

Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xcbce2081

Device Boot Start End Blocks Id System
/dev/sdb1 * 63 1953520064 976760001 7 HPFS/NTFS/exFAT
linux:~ #
*

I looked via the terminal into /boot/grub/ for menu.lst but that file is no where to be found. There is a stage2 however. BUT when i try to find stage2 in the Grub shell with the command
“find /boot/grub/stage2”
i get a file not found error. i included a dump of everything in the grub folder below. I hope that helps
*
linux:/ # cd boot
linux:/boot # ls -al
total 14032
drwxr-xr-x 3 root root 4096 Jan 24 21:57 .
drwxr-xr-x 26 root root 4096 Jan 24 21:58 …
-rw-r–r-- 1 root root 2547268 Nov 5 11:28 System.map-3.1.0-1.2-desktop
lrwxrwxrwx 1 root root 1 Nov 10 16:09 boot → .
-rw-r–r-- 1 root root 1236 Oct 25 17:07 boot.readme
-rw-r–r-- 1 root root 128888 Nov 5 10:30 config-3.1.0-1.2-desktop
drwxr-xr-x 2 root root 4096 Nov 10 16:09 grub
lrwxrwxrwx 1 root root 24 Nov 10 16:12 initrd → initrd-3.1.0-1.2-desktop
-rw-r–r-- 1 root root 180856 Oct 23 04:58 memtest.bin
-rw-r–r-- 1 root root 435712 Nov 10 16:11 message
-rw-r–r-- 1 root root 212271 Nov 5 11:45 symvers-3.1.0-1.2-desktop.gz
-rw-r–r-- 1 root root 515 Nov 5 11:45 sysctl.conf-3.1.0-1.2-desktop
-rw-r–r-- 1 root root 5807889 Nov 5 11:45 vmlinux-3.1.0-1.2-desktop.gz
lrwxrwxrwx 1 root root 25 Nov 10 16:12 vmlinuz → vmlinuz-3.1.0-1.2-desktop
-rw-r–r-- 1 root root 4977392 Nov 5 11:28 vmlinuz-3.1.0-1.2-desktop
linux:/boot # cd grub
linux:/boot/grub # ls -al
total 212
drwxr-xr-x 2 root root 4096 Nov 10 16:09 .
drwxr-xr-x 3 root root 4096 Jan 24 21:57 …
-rw-r–r-- 1 root root 8608 Oct 29 18:12 e2fs_stage1_5
-rw-r–r-- 1 root root 7872 Oct 29 18:12 fat_stage1_5
-rw-r–r-- 1 root root 7136 Oct 29 18:12 ffs_stage1_5
-rw-r–r-- 1 root root 7136 Oct 29 18:12 iso9660_stage1_5
-rw-r–r-- 1 root root 8576 Oct 29 18:12 jfs_stage1_5
-rw-r–r-- 1 root root 7296 Oct 29 18:12 minix_stage1_5
-rw-r–r-- 1 root root 9632 Oct 29 18:12 reiserfs_stage1_5
-rw-r–r-- 1 root root 512 Oct 29 18:12 stage1
-rw-r–r-- 1 root root 102026 Nov 10 16:09 stage2
-rw-r–r-- 1 root root 7456 Oct 29 18:12 ufs2_stage1_5
-rw-r–r-- 1 root root 6688 Oct 29 18:12 vstafs_stage1_5
-rw-r–r-- 1 root root 9288 Oct 29 18:12 xfs_stage1_5
linux:/boot/grub #*

thanks

What about

grub> find /grub/stage2

?

It looks like you have a separate /boot partition.

please_try_again,
so i get the following when i look for stage2 in the grub folder

grub> find /grub/stage2
Error 15 : File not found

Any other pointers? Im all ears and desperate too…

You should do that in a root terminal. So first open a root shell:

su -l

Then start the Grub shell

grub

Then look for /boot/grub/stage2 and /grub/stage2

grub> find /boot/grub/stage2
grub> find /grub/stage2

And show us the content of the file /etc/fstab.

please_try_again,

So i booted into opensuse using the live CD, opened up a terminal and followed the code mentioned above and here is the output:

  • GNU GRUB version 0.97 (640K lower / 3072K upper memory)

Minimal BASH-like line editing is supported. For the first word, TAB
lists possible command completions. Anywhere else TAB lists the possible
completions of a device/filename. ]

grub> find /boot/grub/stage2

Error 15: File not found

grub> find /grub/stage2

Error 15: File not found

grub>
*

Below is the output from the fstab file
*
linux:/etc # cat fstab
devpts /dev/pts devpts mode=0620,gid=5 0 0
proc /proc proc defaults 0 0
sysfs /sys sysfs noauto 0 0
debugfs /sys/kernel/debug debugfs noauto 0 0
usbfs /proc/bus/usb usbfs noauto 0 0
/dev/root / defaults 1 1
/dev/disk/by-id/ata-ST31000333AS_9TE1B9XD-part7 swap swap defaults 0 0
linux:/etc #
*

in the mean time, im just combing through
GRUB bootloader - Full tutorial
to see if theres something else i can do to remedy this problem. please advise. Thanks!

I didn’t mean that one. This is from the live system. I mean fstab in the directory /etc on your hard disk. But I can not tell in which partition it is since you have (too) many. But either /boot or / will probably be in sda3 since this partition has the bootflag.

Device Boot Start End Blocks Id System
/dev/sda1 2048 1024002047 512000000 83 Linux
/dev/sda2 1024015230 1912538249 444261510 f W95 Ext'd (LBA)
/dev/sda3 * 1912538250 1953503999 20482875 83 Linux
/dev/sda5 1024017278 1107903357 41943040 83 Linux
/dev/sda6 1107905406 1114196861 3145728 83 Linux
/dev/sda7 1114198910 1181307773 33554432 82 Linux swap / Solaris
/dev/sda8 1181309822 1912538249 365614214 83 Linux

It neve hurts to read that page. But you should run fsck on all your filesystems when they are NOT mounted. I don’t know actually what the live system exactly mount when you do what. Automounting has always confused (and bothered) me.

That would be:

su -l
fsck /dev/sda1
fsck /dev/sda3
fsck /dev/sda5
fsck /dev/sda6
fsck /dev/sda8 

It it fails, you should do a surface test on your HDD with the Disk Utility program on the live CD:

  • Start Disk Utility
  • Select your hard disk
  • Click on SMART Data
  • Click on Run Self-test

please_try_again,
I think were getting somewhere!!! So i did the fsck and fixed a few bad blocks and the results were fine:

*linux:~ # su -l
linux:~ # fsck /dev/sda1
fsck from util-linux 2.20.1
e2fsck 1.41.14 (22-Dec-2010)
home2: clean, 274432/32006144 files, 115552823/128000000 blocks
linux:~ # fsck /dev/sda3
fsck from util-linux 2.20.1
e2fsck 1.41.14 (22-Dec-2010)
root: clean, 238542/1281120 files, 2739948/5120718 blocks
linux:~ # fsck /dev/sda5
fsck from util-linux 2.20.1
e2fsck 1.41.14 (22-Dec-2010)
usrlocal: clean, 207341/2621440 files, 4610030/10485760 blocks
linux:~ # fsck /dev/sda6
fsck from util-linux 2.20.1
e2fsck 1.41.14 (22-Dec-2010)
var: clean, 2087/196608 files, 158837/786432 blocks
linux:~ # fsck /dev/sda8
fsck from util-linux 2.20.1
e2fsck 1.41.14 (22-Dec-2010)
home3: clean, 1427/22855680 files, 1535532/91403553 blocks
*

Then i went back to your previous suggestions. I booted into opensuse using the live CD and did the following:

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

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

grub> kernel /boot/vmlinu
Possible files are: vmlinux-2.6.37.6-0.9-desktop.gz vmlinuz-2.6.37.6-0.9-desktop

grub> kernel /boot/vmlinuz-2.6.37.6-0.9-desktop Segmentation fault
*

So at least now we can get beyond not being able to find stage2. WUHU!! OK, with that said, what do you think we should do for this segmentation fault? btw, does this mean i have a bad kernel?
Thanks!

I dont know. But now you can do this. From Live CD:

su -l
grub> root (hd0,2)
grub> setup (hd0,2)
grub> quit

It should at least boot in the Grub shell - since sda3 has the bootflag - , where you could enter kernel and initrd as described in post #4
You can - and you should - also install the boot loader in MBR - since you don’t seem to have Windows installed. Are you multi-booting?

To install Grub stage1 in MBR, you would replace setup (hd0,2) with setup (hd0) in the commands above.

Could you now mount sda3 - which means the same as (hd0,2) - and show us /etc/fstab and /boot/grub/menu.lst, as well as the list of files in /boot and /boot/grub in this partition. What you listed previously was the live CD, which is not interesting.

su -l
mount -t ext4 /dev/sda3 /mnt
cat /mnt/etc/fstab
cat /mnt/boot/grub/menu.lst
find /mnt/boot -ls

Please use CODE tages in your reply.

please_try_again,
After mounting sda3, i noticed that menu.lst is totally MISSING. However, there is a menu.lst.old I have its contents listed below. If im understanding the contents of menu.lst.old, it looks like there its currently using an updated kernel ending in 0.9. Could that be the issue? Thanks!

linux:~ # mount -t ext4 /dev/sda3/ mnt
mount: mount point mnt does not exist
linux:~ # mount -t ext4 /dev/sda3/ /mnt
linux:~ # cat /mnt/etc/fstab
LABEL=root           /                    ext3       acl,user_xattr        1 1
#LABEL=home3          /home3               ext3       acl,user_xattr        1 2
LABEL=home2          /home2               ext3       defaults              1 2
#/dev/disk/by-id/ata-ST31000333AS_9TE1B9XD-part5 swap                 swap       defaults              0 0
LABEL=usrlocal       /usr/local          ext3       defaults              1 2
LABEL=var            /var                ext3       defaults              1 2
LABEL=swap1           swap                 swap      defaults               0 0
LABEL=home3          /home3               ext3       defaults              1 2
proc                 /proc                proc       defaults              0 0
sysfs                /sys                 sysfs      noauto                0 0
debugfs              /sys/kernel/debug    debugfs    noauto                0 0
usbfs                /proc/bus/usb        usbfs      noauto                0 0
devpts               /dev/pts             devpts     mode=0620,gid=5       0 0
linux:~ # cat /mnt/boot/grub/menu.lst
cat: /mnt/boot/grub/menu.lst: No such file or directory
linux:~ # find /mnt/boot -ls
791521    4 drwxr-xr-x   3 root     root         4096 Dec 23 01:34 /mnt/boot
791523    0 lrwxrwxrwx   1 root     root           27 Dec 23 01:34 /mnt/boot/initrd -> initrd-2.6.37.6-0.9-desktop
791522    4 drwxr-xr-x   2 root     root         4096 Dec 23 01:34 /mnt/boot/grub
791530    8 -rw-r--r--   1 root     root         7872 Feb 19  2011 /mnt/boot/grub/fat_stage1_5
791535    8 -rw-r--r--   1 root     root         7136 Feb 19  2011 /mnt/boot/grub/ffs_stage1_5
791525    8 -rw-r--r--   1 root     root         7296 Feb 19  2011 /mnt/boot/grub/minix_stage1_5
791526    8 -rw-r--r--   1 root     root         6688 Feb 19  2011 /mnt/boot/grub/vstafs_stage1_5
791533   12 -rw-r--r--   1 root     root         8576 Feb 19  2011 /mnt/boot/grub/jfs_stage1_5
791534    8 -rw-r--r--   1 root     root         7136 Feb 19  2011 /mnt/boot/grub/iso9660_stage1_5
791536    8 -rw-r--r--   1 root     root         7456 Feb 19  2011 /mnt/boot/grub/ufs2_stage1_5
791527   12 -rw-r--r--   1 root     root         8608 Feb 19  2011 /mnt/boot/grub/e2fs_stage1_5
791529   12 -rw-r--r--   1 root     root         9632 Feb 19  2011 /mnt/boot/grub/reiserfs_stage1_5
791991    4 -rw-------   1 root     root         1694 Dec 23 01:34 /mnt/boot/grub/menu.lst.old
791528    4 -rw-r--r--   1 root     root          512 Feb 19  2011 /mnt/boot/grub/stage1
791532   12 -rw-r--r--   1 root     root         9288 Feb 19  2011 /mnt/boot/grub/xfs_stage1_5
791531  104 -rw-r--r--   1 root     root       102026 Aug  3 18:52 /mnt/boot/grub/stage2
791524    0 lrwxrwxrwx   1 root     root            1 Mar  2  2011 /mnt/boot/boot -> .
791983    4 -rw-------   1 root     root          512 Aug  3 18:52 /mnt/boot/backup_mbr
791989 10612 -rw-r--r--   1 root     root     10847997 Dec 23 01:34 /mnt/boot/initrd-2.6.37.6-0.9-desktop
791553 5188 -rw-r--r--   1 root     root      5298258 Oct 26 15:53 /mnt/boot/vmlinux-2.6.37.6-0.9-desktop.gz
791985 4464 -rw-r--r--   1 root     root      4558624 Oct 26 15:39 /mnt/boot/vmlinuz-2.6.37.6-0.9-desktop


linux:~ # cat /mnt/boot/grub/menu.lst.old
# Modified by YaST2. Last modification on Thu Dec 22 17:34:15 PST 2011
# 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 (hd0,2)/boot/message
##YaST - activate

###Don't change this comment - YaST2 identifier: Original name: linux###
title Desktop -- openSUSE 11.4 - 2.6.37.6-0.9
    root (hd0,2)
    kernel /boot/vmlinuz-2.6.37.6-0.9-desktop root=/dev/disk/by-label/root resume=/dev/disk/by-id/ata-ST31000333AS_9TE1B9XD-part5 splash=silent quiet showopts nomodeset vga=0x31a
    initrd /boot/initrd-2.6.37.6-0.9-desktop

###Don't change this comment - YaST2 identifier: Original name: linux###
title openSUSE 11.4
    root (hd0,2)
    kernel /boot/vmlinuz-2.6.37.6-0.7-desktop root=/dev/disk/by-label/root resume=/dev/disk/by-id/ata-ST31000333AS_9TE1B9XD-part5 splash=silent quiet showopts nomodeset vga=0x31a
    initrd /boot/initrd-2.6.37.6-0.7-desktop

###Don't change this comment - YaST2 identifier: Original name: failsafe###
title Failsafe -- openSUSE 11.4
    root (hd0,2)
    kernel /boot/vmlinuz-2.6.37.6-0.7-desktop root=/dev/disk/by-label/root showopts apm=off noresume edd=off powersaved=off nohz=off highres=off processor.max_cstate=1 nomodeset  x11failsafe vga=0x31a
    initrd /boot/initrd-2.6.37.6-0.7-desktop

###Don't change this comment - YaST2 identifier: Original name: linux###
title Kernel-2.6.37.6-0.7-desktop
    root (hd0,2)
    kernel /boot/vmlinuz-2.6.37.6-0.7-desktop root=/dev/disk/by-label/root    resume=/dev/disk/by-id/ata-ST31000333AS_9TE1B9XD-part5 splash=silent quiet showopts vga=0x31a
    initrd /boot/initrd-2.6.37.6-0.7-desktop
linux:~ #

The first entry in your menu.lst.old is correct, except for the resume option which doesn’t seem to point to the swap partition (?). The other entries won’t boot, as this kernel is not present anymore. You can use this as your menu.lst:

# Modified by YaST2. Last modification on Thu Dec 22 17:34:15 PST 2011
# 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 (hd0,2)/boot/message
##YaST - activate

###Don't change this comment - YaST2 identifier: Original name: linux###
title Desktop -- openSUSE 11.4 - 2.6.37.6-0.9
    root (hd0,2)
    kernel /boot/vmlinuz-2.6.37.6-0.9-desktop root=/dev/disk/by-label/root resume=/dev/disk/by-id/ata-ST31000333AS_9TE1B9XD-part**7** splash=silent quiet showopts nomodeset vga=0x31a
    initrd /boot/initrd-2.6.37.6-0.9-desktop

So save this text in the file /boot/grub/menu.lst (as usual as root) and reboot.
Notice that I replace “5” by “7” in the swap partition. If it doesn’t work, just delete the resume option.
Did you move the swap partition? Did you install this system … or somebody did for you? I’m asking because it looks unconventional. Only an advanced user would mount by labels and come to the idea to use a separate /var partition. It’s OK though.

Pleas post the output of this command:

blkid

so that we can see what you are doing with labels on this system (and if they match what they say).