LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-19-2004, 01:26 AM   #1
ViPeRDeSiGnZ
LQ Newbie
 
Registered: Jan 2004
Distribution: Red Hat 9, XP
Posts: 13

Rep: Reputation: 0
problem with grub


Ive been having problems with grub. im a real noob to linux but good with windows. my scenario is i downloaded and burned redhat 9 and installed it on my computer fine and set it to use grub. I formatted and installed redhat on my hdd2 and have windows on hdd1. now when i try to boot from my linux harddrive it says "grub" and stays there forever. I cant get past that and im really mad, any help would be appreciated.
 
Old 01-19-2004, 04:23 AM   #2
Demonbane
LQ Guru
 
Registered: Aug 2003
Location: Sydney, Australia
Distribution: Gentoo
Posts: 1,796

Rep: Reputation: 47
Is grub installed in the MBR or the partition bootsector? Are you able to boot windows?
 
Old 01-19-2004, 06:30 AM   #3
lugoteehalt
Senior Member
 
Registered: Sep 2003
Location: UK
Distribution: Debian
Posts: 1,215
Blog Entries: 2

Rep: Reputation: 49
Is it:
grub
or is it:
grub>
?
 
Old 01-19-2004, 12:32 PM   #4
ViPeRDeSiGnZ
LQ Newbie
 
Registered: Jan 2004
Distribution: Red Hat 9, XP
Posts: 13

Original Poster
Rep: Reputation: 0
grub>

windows boots fine

i beleive grub is in the partition sector, i might be wrong


and also, is it normal for windows not to even see the second hdd when its formatted in linux?

Last edited by ViPeRDeSiGnZ; 01-19-2004 at 12:43 PM.
 
Old 01-19-2004, 01:37 PM   #5
lugoteehalt
Senior Member
 
Registered: Sep 2003
Location: UK
Distribution: Debian
Posts: 1,215
Blog Entries: 2

Rep: Reputation: 49
This is a bit of a long-shot.

Try typing:

kernel (hd1,0)/boot/vmlinuz root=/dev/hda1 devfs=mount <return>
initrd (hd1,0)/boot/initrd.img <return>
boot <return>

If it objects to a line try varying it. For instance loose devfs=mount from the first line. (Grub counts from 0, the first hard drive is hd0, etc.)

Below is the sort of stuff grub expects, but should usually add 'boot' to the end as above. This may well be bollocks.

# the following is the origional file from Mandrake, as it were. Saved as menu.lst.origional, in this directory.
#timeout 10
#color black/cyan yellow/cyan
#i18n (hd0,0)/boot/grub/messages
#altconfigfile (hd0,0)/boot/grub/menu.once
#default 0

#title linux
#kernel (hd0,0)/boot/vmlinuz root=/dev/hda1 devfs=mount
#initrd (hd0,0)/boot/initrd.img

#title failsafe
#kernel (hd0,0)/boot/vmlinuz root=/dev/hda1 devfs=nomount failsafe
#initrd (hd0,0)/boot/initrd.img

#title floppy
#root (fd0)
#chainloader +1

title origional linux
kernel (hd0,0)/boot/vmlinuz root=/dev/hda1 devfs=mount
initrd (hd0,0)/boot/initrd.img

title Origional failsafe
kernel (hd0,0)/boot/vmlinuz root=/dev/hda1 devfs=nomount failsafe
initrd (hd0,0)/boot/initrd.img

title Origional floppy
root (fd0)
chainloader +1
 
Old 01-19-2004, 02:54 PM   #6
marcheikens
Member
 
Registered: Aug 2003
Location: Cleveland, OH
Distribution: Ubuntu 6.06
Posts: 66

Rep: Reputation: 15
Another remedy might be grub-install, if you're trying to get a grub menu at all:

1. Boot from RH Install disc, type 'linux rescue' (without quotes) at prompt.

2. Let it find your Linux installation.

3. Once you get a command line, type 'chroot /mnt/sysimage'

4. Now type 'grub-install /dev/hdd.' That should work.

If you're trying to load grub from the windows boot manager and it's not working, then you have to do steps 1 & 2 above, then:

3. mkdir /mnt/win

4. mount /dev/hdd1 /mnt/win

5. dd if=/dev/hdd2 of=/mnt/win/Linux.bin bs=512 count=1

That should let the windows boot manager find Linux...but make sure you have an entry in the boot manager for linux (there's a utility to do this in windows, I can't remember what it's called...bootfix maybe?).

There's a Dual-Boot how-to on tldp.org I think, that helped me figure all this stuff out when I was having problems with it.

Last edited by marcheikens; 01-19-2004 at 02:57 PM.
 
Old 01-19-2004, 03:01 PM   #7
marcheikens
Member
 
Registered: Aug 2003
Location: Cleveland, OH
Distribution: Ubuntu 6.06
Posts: 66

Rep: Reputation: 15
Oops, Windows boots fine...when you boot for the first time, you see the windows boot manager then, right? Then you need to do the dd if=.... command. Don't do the first part (grub-install), or you'll overwrite the windows boot manager, which is easily fixable but why mess with something that works, right?

Last edited by marcheikens; 01-19-2004 at 03:03 PM.
 
Old 01-20-2004, 12:45 AM   #8
ViPeRDeSiGnZ
LQ Newbie
 
Registered: Jan 2004
Distribution: Red Hat 9, XP
Posts: 13

Original Poster
Rep: Reputation: 0
it says /dev/hhd2 is invalid or something along those lines


i r
 
Old 01-20-2004, 02:27 AM   #9
marcheikens
Member
 
Registered: Aug 2003
Location: Cleveland, OH
Distribution: Ubuntu 6.06
Posts: 66

Rep: Reputation: 15
If hdd2 isn't valid, you have to find out where your /boot/grub/ directory is. If you had only one partition for Linux it should be whatever your / partition is, so if you start up in rescue mode from the cd and type 'mount' alone, it should tell you (whichever partition is mounted at /mnt/sysimage). Use that, and type the 'dd if=....' command, substituting that partition for the if= part ('if' means 'input file').

Here's what I did, long hand:

Linux /boot was /dev/hde1 and Linux / was /dev/hde2. Installed Windows on /dev/hde3. (/dev/hde4 was swap, doesn't matter.) Started up from Linux cd, linux rescue. Then mounted my XP partition to /mnt/win/, typed 'dd if=/dev/hde1 of=/mnt/win/Linux.bin bs=512 count=1'. Before rebooting, edited grub.conf to have:

default=0
timeout=10
splashimage=(hd0,0)/grub/splash.xpm.gz
title Red Hat Linux (2.4.20-6)
root (hd0,0)
kernel /vmlinux-2.4.20-6 ro root=LABEL=/ hdc=ide-scsi
initrd /initrd-2.4.20-6.img
title WinXP
rootnoverify (hd0,2)
chainloader +1

Note that if you have only one partition, the above needs to be changed to reflect that--so before /grub, /vmlinux, and /initrd you need a /boot. Plus, note that (I think) when you install a bootloader on a drive that's not "normally" the first drive seen, like hdd instead of hda, I am pretty sure that one becomes (hd0,0). The first number in that set is the drive number, as grub numbers them, and the second one is the partition number, starting at 0. So if Linux is indeed on /dev/hdd2, then you'll want to use (hd0,1), while for Windows on /dev/hdd1 you'll want (hd0,0).

Next, also before rebooting, vi /mnt/win/boot.ini and made boot.ini look something like this:

[boot loader]
timout=30
default=c:\linux.bin
[operating systems]
multi(0)disk(0)rdisk(0)partition(3)\WINDOWS\"Windows on /dev/hdXX"
c:\linux.bin="Linux on /dev/hdYY"

I think you should only have to change the number after partition, and the XX and YY just for your information, they're just labels. If windows is on hdd1, then partition(1), hdXX should be hdd1, and hdYY should be hdd2.

Just a suggestion: while I've done this about three times (wanted to get things working 'just right' for my computer), the only reason I could remember it was because I wrote down my steps when I got it to work. Keep a journal of the major things you do, that way if/when things go south you can quickly get back to where you were. Oh and don't forget, with the windows boot manager and grub, if things get messed up and don't boot, don't worry, there's always a way to fix it, in my experience. Just start up from your windows or Linux boot disk, and start over. I was wrong above, starting up from the XP install CD doesn't do crap, you need to use a boot disk, then look for commands relating to the boot loader. I think it is bootfix though. It should guide you through a process of fixing the boot loader.

One more thing, whichever you fix last, grub or windows, will be the default one you start up from. I prefer grub first, so I installed that last. I manufactured it so that I get grub at startup, and then if I select windows, it gives me the windows bootloader, where (if I made a mistake) I can select Linux and go back to grub.

Please tell me this helped. It's late and I'm tired, and if I've made serious mistakes then I apologize.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Yet another GRUB problem eqxro Linux - Software 3 08-04-2004 09:27 AM
HDD problem, scancode problem and grub EJ_INSIDE Debian 2 07-15-2004 09:36 AM
Grub setup problem (/boot/grub/stage1 not found) davidas Debian 2 04-28-2004 08:13 PM
grub problem jigs Linux - Newbie 7 09-18-2003 12:16 PM
GRUB problem pupunk98 Linux - Newbie 7 12-26-2002 04:34 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:38 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration