LinuxQuestions.org
Visit Jeremy's Blog.
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 03-17-2004, 08:20 AM   #1
RedHelix
LQ Newbie
 
Registered: Mar 2004
Location: BAWstun Massachusetts
Distribution: Red Hat
Posts: 9

Rep: Reputation: 0
Booting from Grub


Heyo, I browsed through the forums for an answer to this but much of it assumes I have any idea as to what I'm doing, which is unfortunately untrue

I started out with Windows XP on my machine, and when I started learning about Linux I partitioned off about 2.1 gigs to Mandrake 9.2 (using Mandrake's partitioner in the installer.) to try it out. Later on I tossed Mandrake out and put Red Hat 9 on that partition, which is labelled as hda3. It ran great, and being a clueless Linux noob I was glad that the learning curve wasn't as bad as I'd been lead to believe.

Anyways, a few weeks later, a friend of mine pointed out that I had a partition that wasn't being used for anything; hda2 was just 100 megs with nothing on it; it was just a chunk of space formatted as... hm, I think it was a Linux Swap or it might've been Linux Ext2. He offered to use his copy of Partition Magic to format it to FAT so XP could read it, and I said "sure, why not?"

Well, evidently that wasn't a smart idea at all. The pretty bootloading screen that came with RedHat that lists all my hda's has been replaced with a Grub command line prompt. Now, I'm still a Linux noob, and this strikes me as way out of my league. I perused through these forums yesterday afternoon and found a way to boot into XP from it (seriously, I love you guys,) but after reading through various sources like uruk.org's grub manual I still can't figure out how to boot into Red Hat 9. I understand that you have to do a couple of things such as load the kernel and whatnot... that kinda makes sense. But to tell you the truth I really don't know what I should be filling for parameters in those commands, because I'd never really gotten so far into Linux to the point of understanding the kernel. I was mostly just messing around in the development environment.

I tried to just reinstall Red Hat, but something's screwy about the CD and I'm way, way too low in cash to go out and buy another stack. So what should I be typing out, exactly, to boot Red Hat from Grub, or at least how can I find out what parameters I'm supposed to be filling in?
 
Old 03-17-2004, 08:40 AM   #2
Demonbane
LQ Guru
 
Registered: Aug 2003
Location: Sydney, Australia
Distribution: Gentoo
Posts: 1,796

Rep: Reputation: 47
try these in the grub prompt:
Code:
GRUB> root (hd0,2)
if should return the partition type, if its not ext2 try (hd0,1) or even (hd0,3), cycle through until you find your redhat /boot (which actually could've been your hda2)
When you find it, do
Code:
GRUB> setup (hd0)
and see what happens
 
Old 03-17-2004, 08:52 AM   #3
RedHelix
LQ Newbie
 
Registered: Mar 2004
Location: BAWstun Massachusetts
Distribution: Red Hat
Posts: 9

Original Poster
Rep: Reputation: 0
Yeah... root(hd0,2) returned saying the filesystem type is ext2fs. But when I ran setup it said boot/grub/stage1 doesn't exist nor does grub/stage1. I tried this on each partition and same deal.
 
Old 03-17-2004, 08:58 AM   #4
Demonbane
LQ Guru
 
Registered: Aug 2003
Location: Sydney, Australia
Distribution: Gentoo
Posts: 1,796

Rep: Reputation: 47
Chances are hda2 was your /boot, have you made any bootdisk during redhat installation, or are you able to at least boot into rescue mode with the CD?

btw its not a very big deal, its easy to fix, you just need to restore these grub stage files, the kernel image and reinstall grub (which I'll walk you through it).

Last edited by Demonbane; 03-17-2004 at 09:05 AM.
 
Old 03-18-2004, 08:02 AM   #5
glorenfeld
LQ Newbie
 
Registered: Mar 2004
Location: Manchester, UK
Distribution: Slackware 9.1
Posts: 9

Rep: Reputation: 0
Hi,

I am having exactly the same problem and would really appreicate that walkthrough
 
Old 03-21-2004, 11:50 PM   #6
TreeDragon60
LQ Newbie
 
Registered: Feb 2004
Location: Eastern PA
Distribution: Fedora Core
Posts: 16

Rep: Reputation: 0
I am having the same issue - my machine was working great and now it is coming to the grub> prompt on boot and I can't get past it...

Looking forward to hearing the answers!
 
Old 03-22-2004, 12:21 AM   #7
Demonbane
LQ Guru
 
Registered: Aug 2003
Location: Sydney, Australia
Distribution: Gentoo
Posts: 1,796

Rep: Reputation: 47
Quote:
Hi,

I am having exactly the same problem and would really appreicate that walkthrough
Well that depends on what you have in hand and what distro you use, basically you need to find a way to mount your root partition (or /boot), copy apropriate files into it, then reinstall grub. If the kernel image has been deleted as well you need to somehow compile your own or extract the ones provided by your distro.




Quote:
I am having the same issue - my machine was working great and now it is coming to the grub> prompt on boot and I can't get past it...

Looking forward to hearing the answers!
in the grub prompt first you need to find your /boot partition, and this is done by entering
Code:
GRUB> root (hdX,X)
the 2 X's correspond to your harddisk and partition order, and starts to count from 0, so for example if your /boot is in the
first partition of the primary master drive which is the first boot device, you would use root (hd0,0).
It'll reutrn the partition type so you can keep trying until you get it right.
then you can do
Code:
GRUB> root (hd0)
which will reinstall grub back into the mbr, while pointing to the right /boot partition so that GRUB can find its config file.

Last edited by Demonbane; 03-22-2004 at 12:27 AM.
 
  


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
Booting of raw ISO from GRUB/LILO (though preferably GRUB) Orkie Linux - Software 28 12-15-2013 09:37 PM
booting from CD when using grub??? thanos155 Fedora 7 08-04-2005 06:08 PM
Booting xp with Grub corbinc1 Linux - Software 10 03-10-2005 11:20 PM
Booting from CD with Grub eqxro Linux - Software 2 10-03-2004 11:53 PM
GRUB and Booting from 2 HD Psychocop156 Linux - Newbie 2 07-08-2004 06:19 PM

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

All times are GMT -5. The time now is 03:42 AM.

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