Installing Grub the correct way

Hi Everyone.

I have a question. What is the correct way to install GRUB on installation of any Linux Distro or opensuse more so.

Everytime I mess with the boot loader, I have to reinstall my opensuse 11.1. I have to re-install all my applications; but fortunately the data is stored on the /home partition so I don’t have to start from scratch.

The thing is, I get an error when installing the boot loader from the DVD. Plus, if just abort from doing repair, before I tell it do anything, I get an error.

If I have to add entries into GRUB how can I do that manually. I want to show you my current setup to see if it is configured wrong. I don’t know what is the command and I want to post a screenshot.

Very Much thanks:)

GRUB configuration is in /boot/grub/menu.lst. So

cat /boot/grub/menu/lst

gives you the contents of it. Cut and paste it in a post (preferable surrounded by CODE tags). No need for a screenshot!

I think @hcvv
means from a su terminal

cat /boot/grub/menu.lst
fdisk -l

will help if we have to identify your system partitions/OS’s

cat /boot/grub/menu.lst
# Modified by YaST2. Last modification on Fri Jul  3 20:54:21 AST 2009
default 3                                                             
timeout 8                                                             
gfxmenu (hd0,5)/boot/message                                          
##YaST - activate                                                     

###Don't change this comment - YaST2 identifier: Original name: xen###
title Xen -- openSUSE 11.1 - 2.6.27.23-0.1                            
    root (hd0,5)                                                      
    kernel /boot/xen.gz                                               
    module /boot/vmlinuz-2.6.27.23-0.1-xen root=/dev/disk/by-id/ata-TOSHIBA_MK2552GSX_68RBF0YCS-part6 resume=/dev/disk/by-id/ata-TOSHIBA_MK2552GSX_68RBF0YCS-part2 splash=silent showopts vga=0x314                                                
    module /boot/initrd-2.6.27.23-0.1-xen                                        

###Don't change this comment - YaST2 identifier: Original name: linux###
title openSUSE 11.1 - 2.6.27.23-0.1 (default)                           
    root (hd0,5)                                                        
    kernel /boot/vmlinuz-2.6.27.23-0.1-default root=/dev/disk/by-id/ata-TOSHIBA_MK2552GSX_68RBF0YCS-part6 resume=/dev/disk/by-id/ata-TOSHIBA_MK2552GSX_68RBF0YCS-part2 splash=silent showopts vga=0x314                                            
    initrd /boot/initrd-2.6.27.23-0.1-default                                    

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

###Don't change this comment - YaST2 identifier: Original name: linux###
title openSUSE 11.1 - 2.6.27.23-0.1 (pae)                               
    root (hd0,5)                                                        
    kernel /boot/vmlinuz-2.6.27.23-0.1-pae root=/dev/disk/by-id/ata-TOSHIBA_MK2552GSX_68RBF0YCS-part6 resume=/dev/disk/by-id/ata-TOSHIBA_MK2552GSX_68RBF0YCS-part2 splash=silent showopts vga=0x314                                                
    initrd /boot/initrd-2.6.27.23-0.1-pae                                        

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

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

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

###Don't change this comment - YaST2 identifier: Original name: floppy###
title Floppy
    rootnoverify (fd0)
    chainloader +1

And the output of your fdisk

cat /boot/grub/menu.lst

Modified by YaST2. Last modification on Fri Jul 3 20:54:21 AST 2009

default 3
timeout 8
gfxmenu (hd0,5)/boot/message
##YaST - activate

###Don’t change this comment - YaST2 identifier: Original name: xen###
title Xen – openSUSE 11.1 - 2.6.27.23-0.1
root (hd0,5)
kernel /boot/xen.gz
module /boot/vmlinuz-2.6.27.23-0.1-xen root=/dev/disk/by-id/ata-TOSHIBA_MK2552GSX_68RBF0YCS-part6 resume=/dev/disk/by-id/ata-TOSHIBA_MK2552GSX_68RBF0YCS-part2 splash=silent showopts vga=0x314
module /boot/initrd-2.6.27.23-0.1-xen

###Don’t change this comment - YaST2 identifier: Original name: linux###
title openSUSE 11.1 - 2.6.27.23-0.1 (default)
root (hd0,5)
kernel /boot/vmlinuz-2.6.27.23-0.1-default root=/dev/disk/by-id/ata-TOSHIBA_MK2552GSX_68RBF0YCS-part6 resume=/dev/disk/by-id/ata-TOSHIBA_MK2552GSX_68RBF0YCS-part2 splash=silent showopts vga=0x314
initrd /boot/initrd-2.6.27.23-0.1-default

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

###Don’t change this comment - YaST2 identifier: Original name: linux###
title openSUSE 11.1 - 2.6.27.23-0.1 (pae)
root (hd0,5)
kernel /boot/vmlinuz-2.6.27.23-0.1-pae root=/dev/disk/by-id/ata-TOSHIBA_MK2552GSX_68RBF0YCS-part6 resume=/dev/disk/by-id/ata-TOSHIBA_MK2552GSX_68RBF0YCS-part2 splash=silent showopts vga=0x314
initrd /boot/initrd-2.6.27.23-0.1-pae

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

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

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

###Don’t change this comment - YaST2 identifier: Original name: floppy###
title Floppy
rootnoverify (fd0)
chainloader +1

The second part of that last post is not fdisk -l
It’s menu.lst again!!

Tell us what you want to achieve here:

sooo sorry about that last post.

fdisk -l

Disk /dev/sda: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x0005abf0

Device Boot Start End Blocks Id System
/dev/sda1 1 5099 40955904 7 HPFS/NTFS
Partition 1 does not end on cylinder boundary.
/dev/sda2 5100 5300 1614532+ 82 Linux swap / Solaris
/dev/sda3 5301 10474 41560155 7 HPFS/NTFS
/dev/sda4 * 10475 30401 160063627+ f W95 Ext’d (LBA)
/dev/sda5 10475 21521 88726995 7 HPFS/NTFS
/dev/sda6 21521 23729 17743729+ 83 Linux
/dev/sda7 23730 30401 53592808+ 83 Linux

I want to know if that GRUB setup is right. I’ll be on the road in a bit and not be able to talk for a while.

Everytime I mess with the boot menu i get whole lot of problems describe in my first post

Initially in the released 11.1 (not updated) there was a bug that broke grub if you tried configuring the bootloader (eg; some moved the windows to boot by default). Basically that just moves the windows entry in menu.lst to the top of the list. But this has been fixed via updates.

Most of the time there should be no reason to alter the menu.lst
Unless you do a lot of testing of new releases eg; currently milestone 3
But I don’t think that applies to you.

Though there should be no reason why the repair feature should not work. You might want to read this:
HowTo Boot into openSUSE when it won’t Boot from the Grub Code on the Hard Drive

Remember it’s best not to fiddle and if it ain’t broke - don’t try and fix it.

Or you have multiple distros installed across several partitions, and openSUSE (or the distro controlling the MBR) has a kernel update and menu.lst gets automatically updated. Unfortunately, vga= parameters (for resolution setting) get dropped, and/or the list of distros gets rearranged unhelpfully, so you have to get familiar and edit.:wink:

O, I am so sorry, when you give a command it should be flawlessly and ready to for cut/paste. I appologize again for my typo. this is one of those things that will hose *root *sooner or later!

Thanks caf fot the link. I’ve been there before. Unfortunately those steps did not really work. I could not boot, the linux disk from the DVD. I get an error. super grub disk failed in every way dealing with grub and also in trying to boot the Linux.

I guess its the bug from 11.1 disk.

I guess its the bug from 11.1 disk.
No
It works just fine as does SuperGrubDisk.

There is no substitute for experience. If you want some, try messing in Virtual Box.

You mean actually installing opensuse on virtual box?

Yes.
Just so you can mess with breaking and re-installing grub, using other utilities to assist and so on.