Grub not working

Hi,

I’m new to Linux having only just installed openSUSE this afternoon (from a Live disk).

Everything went well except for some reason it won’t boot without the live disk in. When I boot with the disk in and I choose to boot from the hard drive grub appears with openSUSE 11.1 and openSUSE 11.1 Failsafe as options - and these both work fine.

Without the disk, all I get is a message saying “GRUB loading stage 2” and “GRUB Loading, please wait…” Then nothing.

Any assistance would be gratefully received!

Boot from the live cd and then once running, go to yast>system>bootloader and choose bootloader installation. This should let you fix it.

Thanks for the reply.

I tried what you suggested but to no avail.

Any other ideas?

Thanks very much in advance

In addtion, when I tried to go into the BootLoader option in Yast (when run from the live CD) it said bootloader couldn’t be installed because of the partitioning.

The message you got from YaST Boot Loader module sounds like one of the two bugs recently fixed. Run YaST Online Updates and scan the patches list (change the filter to see all patches); you’re looking for “perl-bootloader” and “parted”. Install those patches and re-run YaST Boot Loader. Report back.

Thanks for the reply.

No joy I’m afraid. Installed those two patches successfully and re-ran the YaST bootloader, played with all the options (such as setting it to boot from MBR, boot partition, root partition etc.

Additionally, when running the YaST bootloader from the live CD, I still get the same error message. When running it from the installed OS it seems to run fine.

Thanks in advance for any other help

I’m new to Linux having only just installed openSUSE this afternoon (from a Live disk).

Try a repair/reinstall with the oS 11.1 DVD. As this was your first boot, there would not be any User settings to alter.

You cannot do this with a LiveCD; it is running the OS in ram, the root file system is not mounted. You also may not be able to do a repair from the 11.1 DVD because it has the 2 bugs that were patched.

We need to see some data. Boot into openSUSE, open a terminal, and post back here the output from the following:

su -
fdisk -lu
cat /etc/grub.conf
cat /boot/grub/device.map
cat /boot/grub/menu.lst
exit

Here is the requested output:

linux-ohxb:~ # fdisk -lu

Disk /dev/sda: 50.0 GB, 50018393088 bytes
255 heads, 63 sectors/track, 6081 cylinders, total 97692174 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0xace22e9e

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1              63     1349459      674698+  82  Linux swap / Solaris
/dev/sda2   *     1349460    39969719    19310130   83  Linux
/dev/sda3        39969720    97691264    28860772+  83  Linux

linux-ohxb:~ # cat /etc/grub.conf
setup --stage2=/boot/grub/stage2 --force-lba (hd0) (hd0,1)
quit

linux-ohxb:~ # cat /boot/grub/device.map
(hd0)   /dev/disk/by-id/ata-ST950212A_3LE0698X

linux-ohxb:~ # cat /boot/grub/menu.lst
# Modified by YaST2. Last modification on Mon Feb 16 14:11:01 GMT 2009
default 0
timeout 8
##YaST - generic_mbr
gfxmenu (hd0,1)/boot/message
##YaST - activate

###Don't change this comment - YaST2 identifier: Original name: linux###
title openSUSE 11.1
    root (hd0,1)
    kernel /boot/vmlinuz root=/dev/disk/by-id/ata-ST950212A_3LE0698X-part2 resume=/dev/disk/by-id/ata-ST950212A_3LE0698X-part1 splash=silent showopts vga=0x317
    initrd /boot/initrd

###Don't change this comment - YaST2 identifier: Original name: failsafe###
title Failsafe -- openSUSE 11.1
    root (hd0,1)
    kernel /boot/vmlinuz root=/dev/disk/by-id/ata-ST950212A_3LE0698X-part2 showopts ide=nodma apm=off noresume nosmp maxcpus=0 edd=off powersaved=off nohz=off highres=off processor.max_cstate=1  x11failsafe vga=0x317
    initrd /boot/initrd

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

###Don't change this comment - YaST2 identifier: Original name: linux###
title Kernel-2.6.27.7-9-default
    root (hd0,1)
    kernel /boot/vmlinuz-2.6.27.7-9-default root=/dev/disk/by-id/ata-ST950212A_3LE0698X-part2 resume=/dev/disk/by-id/ata-ST950212A_3LE0698X-part1 splash=silentshowopts vga=0x317
    initrd /boot/initrd-2.6.27.7-9-default

Thanks again for any help.

Boot openSUSE with your workaround to get to the hard disk (that is, don’t boot the LiveCD itself), then open a terminal, and do:

su -
grub
root (hd0,1)
setup (hd0,1) (hd0,1)
exit

dd if=/usr/lib/boot/master-boot-code of=/dev/sda bs=440 count=1

This puts generic (DOS) boot code in the MBR (openSUSE install grub to the MBR) and installs grub to the sda2 partition boot sector. Please be very careful to type the above exactly as shown.

Remove the CD and reboot. Result?

Copied and executed the code exactly as described but it still won’t let me boot!

Although it now hangs at Loading Stage 2 (which I suppose is progress!).

I really appreciate the time you’re taking to help me with this. I’ve wanted to give Linux a real go for a while and I don’t intend to give up now!

Thanks in advance for any further help

Let’s try reinstalling grub to the partition boot sector using the LiveCD as before, except this way:

su -
grub
root (hd0,1)
setup --force-lba (hd0,1) (hd0,1)
exit

Report back.

No joy, still hanging at stage 2 :frowning:

Please try the following: Start the system and at the grub menu, hit the Escape key. A popup will say you are about to enter text mode; click OK. Then press the ‘c’ key. This should drop you into the grub shell (you’ll get a grub> prompt). Then do:

find /boot/grub/stage2

Grub should return: (hd0,1). If not, report back what it did. If so, then do:

root (hd0,1)

Grub should return: Filesystem type is ext2fs, partition type 0xfd. If not, report back. If so, continue with:

kernel /boot/vmlinuz root=/dev/sda2
initrd /boot/initrd
boot

What happens?