Windows + OpenSuse dual boot configuring GRUB

You can read more about “Installing Opensuse 11.2″ and “OpenSUse Linux driver issues”.

GRUB (GRand Unified Bootloader) is a free multiboot software that is loaded at boot and displays available OS. Under OpenSuse 11.2, you’ll find GRUB configuration file in /boot/grub/menu.lst. Open a terminal and type

kdesu kwrite /boot/grub/menu.lst

to open and edit GRUB configuration file (you’ll be asked root password).

GRUB structure

GRUB configuration file has the following structure :

  • options : Default OS => OS that loads at boot by default
  • timeout : time GRUB loader screen will be displayed before automatically booting
  • several sets of configuration lines associated with each available OS

Setting default boot

In order to set the default OS in GRUB file, simply change the line

default 0

This will load the first OS listed in GRUB file while default 1 will load the second OS listed instead.

OSs boot configuration

In my own configuration, I have 2 hard disks (OpenSuse installed on the first hard disk and Windows7 installed on the second HD) :

hd0 hosts OpenSuse OS and hd1 hosts Windows 7. So GRUB configuration file should take this structure into account :

#OpenSuse 11.2
title openSUSE 11.2 – 2.6.31.8-0.1
root (hd0,1)
kernel /boot/vmlinuz-2.6.31.8-0.1-default root=/dev/disk/by-id/ata-WDC_WD3000HLFS-01G6U1_WD-WXE0C7912926-part2 resume=/dev/disk/by-id/ata-WDC_WD3000HLFS-01G6U1_WD-WXE0C7912926-part1 splash=silent quiet showopts vga=0x31a
initrd /boot/initrd-2.6.31.8-0.1-default

#Windows7
title windows7
map (hd0) (hd2)
map (hd2) (hd0)
rootnoverify (hd2,0)
chainloader +1

I’ve just added the “Windows7″ section to the original file. This configuration uses the swapping technique since Windows can’t boot if it is not installed on the first HD (hd0). As I’ve installed it on hd2 (it may be hd1 on your machine), GRUB will virtually swap the first and second HD throug map command.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>