LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Booting from Grub (https://www.linuxquestions.org/questions/linux-newbie-8/booting-from-grub-158916/)

RedHelix 03-17-2004 08:20 AM

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 :p

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?

Demonbane 03-17-2004 08:40 AM

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

RedHelix 03-17-2004 08:52 AM

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.

Demonbane 03-17-2004 08:58 AM

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).

glorenfeld 03-18-2004 08:02 AM

Hi,

I am having exactly the same problem and would really appreicate that walkthrough :D

TreeDragon60 03-21-2004 11:50 PM

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!

Demonbane 03-22-2004 12:21 AM

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.


All times are GMT -5. The time now is 07:09 AM.