GRUB loader problem...

Hey, this is my first post, I’m an old school windows user who’s making the leap into Linux :slight_smile: We’re making the move as a family and are going to be trying out a variety of Distros, OpenSUSE being the first. (for more info check out The Bray’s Blog).

For now I have two problems, one’s relevant here the other is an application problem… So here’s my GRUB problem:

When I boot up the computer the GRUB screen appears and allows me to pick what OS I want to load. However, if i try to choose either of the Windows options it fails to boot windows. I think that this is due to the grub loader and opensuse being on a different hard drive to windows, or something to do with the BIOS primary boot drive.(I know windows is the root of all evil but there’s some things that i still need windows for atm :eek:)

Anyone know how to fix this? I’m kinda very stuck.

Cheers,
-Cyph (aka James)

cyphnar wrote:
> Hey, this is my first post, I’m an old school windows user who’s making
> the leap into Linux :slight_smile: We’re making the move as a family and are going
> to be trying out a variety of Distros, OpenSUSE being the first. (for
> more info check out ‘The Bray’s Blog’ (http://www.brayblog.co.uk)).
>
> For now I have two problems, one’s relevant here the other is an
> application problem… So here’s my GRUB problem:
>
> When I boot up the computer the GRUB screen appears and allows me to
> pick what OS I want to load. However, if i try to choose either of the
> Windows options it fails to boot windows. I think that this is due to
> the grub loader and opensuse being on a different hard drive to windows,
> or something to do with the BIOS primary boot drive.(I know windows is
> the root of all evil but there’s some things that i still need windows
> for atm :eek:)

Post the contents of /boot/grub/menu.lst and a complete description of your disk
layout.

FYI, I have one GRUB installation that boots Windows, one Linux installation on
a different partition on that disk, and two others located on a separate disk.

Larry

When you install open suse one of you,re drive
was the primary boot device do not change it
after you install opensuse
What I mean is if SDA was primary drive when you install opensuse SDA should the primary again when you boot opensuse
If you install opensuse on SDB and write GRUB on MBR SDB and SDB was primary then again booting opensuse SDB should be primary
Where you install GRUB dos not matter as long as when you bootup you have the same situation

regards
dobby9

To add a tad to lwfinger@ post . . . we need to know how the disks are sequenced, i.e., which is sda, sdb, etc. Also post back the contents of device.map; it’s in the same folder as menu.lst. Conventionally, the Windows boot loader (used by both instances) will be on the first partition of the first drive in the sequence, which will also have been the first drive in the boot device sequence when Windows was installed; if you have something different, we need to know that, too. Finally, to boot from grub now, did you change the bios boot device sequence to boot from the second drive?

Thanks for the replies so far!

For both “device.map” and “menu.lst” when I try via terminal I get access denied (despite bing super user) and when I tried via file browser it says they could not be opened and the icons have a red cross against them.

The drives are set up like this…

Drive 1 - Windows installed on one partitions, and another empty partition formatted for windows (this is how the pc came…)

Drive 2 - Linux installed on the drive, and this is where the GRUB loader is located.

Originally BIOS was booting drive 1 this meant after installing Linux we would still go into windows with no GRUB loader screen etc. So we changed the boot sequence to boot drive 2 first meaning we get Linux and the GRUB loader, however the loader can’t open load windows if you try to.

Cheers,
-Cyph

cyphnar wrote:
> Thanks for the replies so far!
>
> For both “device.map” and “menu.lst” when I try via terminal I get
> access denied (despite bing super user) and when I tried via file
> browser it says they could not be opened and the icons have a red cross
> against them.

Curious. Please enter the commands below and post the results:

ls -l /boot/grub/menu.lst
ls -l /boot/grub/device.map

Larry

The device.map and menu.lst files should be readable by root (lwfinger’s request is to take a look at the permissions on those files to make sure there isn’t a problem).

>su
<enter password>
#cd /boot/grub
#cat device.map
#cat menu.lst

You can highlight the text with the cursor and the copy/paste to the posting window in the browser.

My guess is that device map looks something like this:

(hd0,0) /dev/sda1
(hd0,1) /dev/sda2
(hd1,0) /dev/sdb1

With /dev/sda the drive Windows is on. You have installed grub to the MBR of /dev/sdb, are booting SuSE from /dev/sdb1, and you have this second drive configured in the bios as the boot drive.

If so, then the Windows stanza in menu.lst needs to look like:

rootnoverify (hd0,0)
chainloader (hd0,0)+1

It may need a map command added to the stanza, which would be:

map (hd1) (hd0)

Note: You do not need to make changes to device.map and/or menu.lst to test what works, rebooting each time. You can do the commands in the stanza interactively from the boot menu. Just hit Escape at the graphical boot menu to go to a text grub menu, tab to the windows entry, and type “e”. You will see the edit commands to change the stanza, exactly as you would with menu.lst

as requested:

dad@linux:~> ls -l /boot/grub/menu.lst
-rw------- 1 root root 1401 Jul  5 08:15 /boot/grub/menu.lst
dad@linux:~> ls -l /boot/grub/device.map
-rw------- 1 root root 30 Jul  5 08:15 /boot/grub/device.map

and


dad@linux:~> su
Password: 
linux:/home/dad # cd /boot/grub
linux:/boot/grub # cat device.map
(hd0)   /dev/sda
(hd1)   /dev/sdb
linux:/boot/grub # cat menu.lst
# Modified by YaST2. Last modification on Sat Jul  5 08:15:43 BST 2008
default 0
timeout 8
gfxmenu (hd0,4)/boot/message

###Don't change this comment - YaST2 identifier: Original name: linux###
title openSUSE
    root (hd0,4)
    kernel /boot/vmlinuz-2.6.22.5-31-default root=/dev/disk/by-id/scsi-SATA_MAXTOR_STM32503_6RY93TAZ-part5 vga=0x31a resume=/dev/sda1 splash=silent showopts
    initrd /boot/initrd-2.6.22.5-31-default

###Don't change this comment - YaST2 identifier: Original name:  openSUSE (/dev/sda2)###
title  openSUSE (/dev/sda2)
    rootnoverify (hd0,1)
    chainloader +1

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

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

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

###Don't change this comment - YaST2 identifier: Original name: failsafe###
title Failsafe -- openSUSE
    root (hd0,4)
    kernel /boot/vmlinuz-2.6.22.5-31-default root=/dev/disk/by-id/scsi-SATA_MAXTOR_STM32503_6RY93TAZ-part5 vga=normal showopts ide=nodma apm=off acpi=off noresume nosmp noapic maxcpus=0 edd=off 3
    initrd /boot/initrd-2.6.22.5-31-default
linux:/boot/grub # 

Does that help? :confused:

-Cyph

Yes. (By the way, my example above of device.map is wrong - I hadn’t had my coffee yet - only the drives are mapped, not the partitions, as you see in your file.)

In a text editor in menu.lst, as root, in the windows 1 stanza, add the line:

map (hd1) (hd0)

And change the chainloader line to be:

chainloader (hd1,0)+1

Also, remove the second windows stanza altogether.

Erm… little help! :eek:

Lol, ok I tried opening menu.lst via gedit … said I didn’t have the right permission… but I don’t know how to log in as the super user outside of the terminal :confused: so I tried in the terminal:

logged in as super user

cd /boot/grub

cat menu.lst

that showed me the file again so I guessed and tried replacing “cat” with “edit”

edit menu.lst

woot, this seems to have worked it lets me make the changes anyway, here’s my question, how do I save the changes I’ve made?

speedy answers much appreciated!

-Cyph

don’t worry!

i flicked through my “essential commands, linux pocket guide” book and found stuff on editing within the shell/terminal. quickly figured out i was using vim and found the command to save and quit is

 :wq

:smiley:

cheers,
-Cyph

Normally any program opens without root permisiont. This mean any system files including Grub are read only.

Do the following to open gedit with root permisions:
Open a terminal.
Log in as root.
Open menu.lst in gedit with the following:

gedit /boot/grub/menu.lst

This should open gedit with root permisions. Make the changes as sugested in previous post and save it normally.

I’m an old school windows user who’s making the leap into Linux http://forums.opensuse.org/images/smilies/smile.gif We’re making the move as a family and are going to be trying out a variety of Distros, OpenSUSE being the first. (for more info check out The Bray’s Blog).

Excellent work! Welcome to the wonderfull world of Linux! And thank you for making OpenSUSE your first test.You will not be dissapointed.

Have you tried KDE as a desktop manager yet? I personally prefer it over Gnome but Linux is all about choice so if it suits you better, Go for it!

Ok, so after that slight achievement I rebooted and attempted to boot windows. It failed. I received the following message:

Could this have anything to do with me changing “windows 1” to “windows XP” ? (tempted to change it to “windoze heXP”)

thanks for the hint/tip/help dexter! I’ll have to remember that one!

-Cyph

Looks like a misplelling of the device name.

Your windows entry looks complex and only 1 is needed.
I am not good at doing these things from work looks to see if boss is looking and I have a windows pc here. :slight_smile:

When I am home I’ll post my menu.lst.
I have 2 had, 1 with openSUSE 11 (sda) and 1 with windows XP with original boot loader on sdb.

I think I have 4 options in my grub.
OpenSUSE 11
OpenSUSE 11 Failsafe
OpenSUSE 11 (XEN)
and Windows XP.
All lines look really simple.

Out of interest, did you do anything to the hard drive with windows? As in, did you add a hard drive and installed OpenSUSE on that?

The editor you invoked is VIM (an improved VI); VI was designed for programmers, and is still extensively used by such plus old systems geeks who pre-date gui’s (who me???). It is very fast to use, once you know the syntax and keystrokes. But difficult for new or typical users. Not worth it to learn (unless you plan on cutting code), and, caution, if you get into it as root and you could inadvertently change something. There are other built-in command line editors (like, er, “ed”), but again, programmer tools.

You should be able to get into a graphical editor; per the ls output you posted back earlier, the file has root only read-write permissions. If you tried gedit, you must have installed gnome. From the terminal line not as root, you would type:

>gtksu gedit

gtksu (in KDE, it’s kdesu) runs a program as root, but does so through the gnome mechanisms. Running gedit as root (#gedit) also works, but >gtksu is preferred.

If for some reason you have trouble with that, you can easily edit the file in the terminal. And, this is good to know should the occasion arise that X won’t start and you need to edit a config file from the command line. So I’ll include this:

Check to see is you have nano or pico already installed; just invoke it from the prompt (>nano or >pico). If you don’t have one of these, go into YaST Software Mangement and install nano. Both are very nifty, fairly intuitive, command line editors. To edit menu.lst, all you need to do is:

>su
<enter root password>
#cd /boot/grub
#nano menu.lst

In nano, you edit interactively using the keyboard; move around with the arrow keys. The commands you’ll need are shown at the bottom (or you can enter the help facility), and they all are invoked by depressing the Ctrl key and applicable letter. A carriage return at the end of a line creates a new empty line, like needed to add the above. Then Ctrl-o to save the file. To scroll through what you’ve done, just:

#more menu.lst

Re my prev post, let me also suggest that you add two “map” lines not just one, thus:

map (hd0) (hd1)
map (hd1) (hd0)

Probably only one line is required, but I’ve also seen it done using two; safer that way.

Finally, you can test adding the map command without editing the menu.lst file. When you boot to the SuSE menu, hit Escape and you will be taken out of the graphical interface to a text interface. Choose the windows title (move with arrow keys) and hit “e”, and grub will display the full stanza. Position the cursor at the top line and type “O” (capital “o”), and a new line will be inserted. Then type “e” and grub presents a edit prompt; type in your command and hit return. Repeat for the second line. When you’re finished, type “b” and grub will boot from that stanza. When you find what works, you’ll know exactly what you need to add to menu.lst. To return from the stanza to the grub menu, hit Escape.

Dexter
We had windows installed on the C drive (this has been partitioned into C & E). not wanting to risk the “valuable” windows data… we bought a new hard drive (sata maxtor 250 GB) added that to the system and installed OpenSUSE 10.3 (i have a disc with that install on, hence not 11).

Mingus
Thank you for all the help! Not only is it exactly what I need, but its very readable and the “geek” language is explained!

I’ve included the suggested second map line, and I’m just going to re-boot now. fingers crossed!

And to jump the gun completely… is there an easy way to up-grade to 11? :smiley:

Thanks,
-Cyph

I’m confused about using the map command in Grub. I am not a Linux expert but all I’m saying is I have my Xp booting fine without a map option. Maybe it’s because my second drive is ALL XP. Including the MBR and bootloader. If I remove my Linux disc XP starts without a problem.

That didn’t work, it returns the error 11 thing again :S

just to clarify the HDD’s are as follows:

HDD1 - original
P1
Windows
P2
empty - formatted for windows
HDD2 - new
Linux
GRUB Loader (afaik)

Now I’m completely stuck :confused:
-Cyph

I’ll post my menu up in about an hour. Still at work.
I have the same setup. So it should work for you as well. :slight_smile:

Dexter1979@ and cyphnar@

The grub map command is commonly - but not always - used in chainloading to a Windows boot disk when you are booting from a different disk, because Windows needs to think it is booting from the first disk. Another solution with some bios’s is changing the boot sequence there. But it doesn’t work the same way on all systems. The critical factor is to get alignment between the sequence the bios passes to the boot loader, the grub device sequence file, the OS sequence, and the syntax used in menu.lst. Unfortunately, bios’s are not consistent with how the sequence is passed. This is one reason why it is such a challenge for boot installation scripts to figure out exactly how to configure grub.

First, let’s try some quick and dirty. I gave you a change to make with the chainloader command. Boot into the grub menu, hit Escape, highlight Windows entry, hit “e”, highlight one by one the map commands and hit “d” to delete those lines, make sure the chainloader command is changed to exactly what I gave you earlier, then hit “b”. Now, if that fails, go back to the stanza again, edit the chainloader command to (hd0,0), and try it again. If that doesn’t work, we need to dig deeper.

The error 11 that you got is usually due to bad syntax, not an incorrect command - as it was above, when there was a space missing in the map command. Please re-post your menu.lst. Also, please post output of:

#fdisk -l /dev/sda
#fdisk -l /dev/sdb

We also need to be sure which disk’s MBR is actually being booted. Ordinarily in a setup like yours, you would install grub to the MBR of the second disk and set the bios to boot the second disk, and then chainload back to the first disk for Windows booting. But you could have installed grub to the first disk and are booting SuSE from the second disk; this will change the syntax you use in menu.lst. So go into your bios boot setup. Set the boot disk to the first disk, which we presume is Windows, and then boot. If you boot into Windows, grub is on the second disk. If you boot into grub, it’s on the first disk. Also try setting the bios to the second disk and booting to see what happens.

Hang in, you’re close.