LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 02-29-2004, 09:34 PM   #1
deviousdoses
LQ Newbie
 
Registered: Feb 2004
Posts: 18

Rep: Reputation: 0
Need help re-installing Grub Please


I am fairly new to linux, but heres what's going on...

I have had redhat 7 through 8 installed over the years on a dual booting system, had problems with windows xp (imagine that?) and was able to re-install and recover the os... My main concern now is that I no longer have Grub anymore? :-(

I am almost certain it was not installed on the MBR but on one of the linux partitions....

Another major problem I have is that I am having probs with my floppy drive, so I am unable to boot from floppy disk.

I tried running "linux-rescue" via the redhat 8 install cd, but instead of detecting my linux partitions: the redhat 8 install rather, it continued to install like it was doing a clean install? I even tried selecting upgrade, and got the error, no linux partitions found.....

It did not find, nor mount my linux partition in the /mnt/sysimage scheme...
I was able to mount it manually using the mount command after looking at my partition tables with ease though...

I tried switching to virtual console 2, then at the bash I tried using the
grub-install command to try re-installing grub.... Sound simple enough I thaught to myself.... But I can't find the command any where...

I tried using the find command in conjunction with grep, and even after mounting my linux partition, I couldn't find anything that resembles grub or grub-install anywhere?? Looks like windows also Deleted my /boot partition?? Now I only have two linux partitions, /root - root filesystem /home - programs and stuff, plus a swap partition....

Again I am no linux guru, but I have been playing with redhat for a few years now.... I desperately need some help resolving this grub thing, I've been at it for two days now, and I'm stumped...

If I do a fdisk -l and look at the partition tables everything is still there, in fact my "grub.conf" file shows my multi boot setup fine, only prob is I think windows took over when I reinstalled it and rewrote the mbr , plus my linux boot partition is gone? It was only like 8 megabytes, but it did it's trick, I thnk thats where I used to have grub installed... So If I've been booting for years from grub, and the grub.conf file is perfect sittingin the /etc directory, where is the grub command? Argh!

I really loved grub, I was able to easily switch between windows xp and my different kernel builds of redhat with such ease, now it's g one... Is there a was to just add it to the boot.ini on windows, or do I have to do some crazy stuff like I've read such as exporting the the linux loader using the dd command then copy it to windows... arggh, I want my Grub back.,.. I even tried installing the rpm, but got huge dependency problems, probably cause I'm in rescue mode.

I even tried using vmware from windows and boot the raw partition like I've done in the past, but with the boot partition gone, this is usless... I did notice though that windows is booting from both hd0,1 and hd 1,1... seems like ntloader is on both of these partitions.... wierd? I also remember when I install grub initially it wasn't on the mbr, but on the first sector of the linux partition or something, if that makes any sense....

Is there a way to boot into my linux partition using the cdrom? The only thing that's missing is my /boot partition, and from what I've read, I don't even need that anymore, as grub can boot from mbr or first sector on a partition? maybe then I'll be able to install grub and then fix this mess...

Any help is appreciated, Thanx in advance!
 
Old 03-01-2004, 02:57 AM   #2
spuzzzzzzz
Member
 
Registered: Sep 2003
Location: Australia
Distribution: Gentoo
Posts: 465

Rep: Reputation: 30
To reinstall grub, you need a working boot partition. Then boot into linux (using a boot floppy) and type "grub". You get a command prompt like this:

grub> root (hd0,0)
grub> setup (hd0)
grub> quit

NOTE: root (hd0,0) assumes your boot partition is on hd(0,0) (aka /dev/hda1). You will probably need to modify this.

Regarding the disappearance of your boot partition, it could be that your system is set up not to mount it at boot time. Look in /etc/fstab to see which partition has the boot data.
 
Old 03-01-2004, 09:16 AM   #3
deviousdoses
LQ Newbie
 
Registered: Feb 2004
Posts: 18

Original Poster
Rep: Reputation: 0
grub grub grub

I wish I had a linux floppy to boot from, besides my floppy drive is messed up.... Also it seems that my 8 megabyte /boot partition is gone? I've tried remaking the /boot partition on hda1, but get errors from disk druid as the end cylinder is that same as the start 1 and 1....

I've hear that I don't need a /boot partition with grub, and that the grub boot loader can be installed on anypartition, is this true?

Also, I am able to get to the grub shell prompt by running linux-rescue which ultimately tries to re-install linux instead of finding my linux partitions, but I am able to mount my redhat partition manually once Im in virtual console 2, then run grub from my /sbin dir from my linux partition...
So I geuss Im confused bigtime, the root (hd0,0) and setup (hd0)
commands will re-install grub on /dev/hda1?

Fstab shows where my /boot partition was, but as I've sais previously, the boot partition is gone now :=(



Thanx again for the assistance, but I'm still scratching my head.....
 
Old 03-01-2004, 10:05 AM   #4
DavidPhillips
LQ Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
I believe it's linux rescue not linux-rescue
 
Old 03-01-2004, 12:48 PM   #5
deviousdoses
LQ Newbie
 
Registered: Feb 2004
Posts: 18

Original Poster
Rep: Reputation: 0
Grub Nightmares almost over...

After days of agony, and alot of help from this forum, I am almost back up and runnig with Grub... :-)


David was right, it's 'linux rescue' not "linux-rescue", but either way, it still wouldn't find my linux partitions...

After staring at a shell for a few minutes I began to manually make dirs for my linux mount points, and manually mounted them, then chrooted to the rfs, edited back the "grub-install" to ommit the changes I made, then played with grub shell for time on end....

After what seemed forever of trying to master the grub shell commands and their syntax, I was finally able to figure out I had to find what hd0,x and hd1,x really translated to as far as /dev/hddx...

The syntax had me for a while as well, especially the brackets...finally figured it out with the help from someone on these threads, sorry can't remember your name. So I tried root (hd0,0) the (hd0,1) then (hd1,1) etc, etc....

Looks like root (hdx,x) verifies the partition, then the setup (hdx)
command install grub on that partition....

I got several errors runnning setup (hdx) the first few times, all the same.
Starts out looking for grub stage 1, stage 2 and some other goodies, complains that it can't find the items then, says grub installation failed...


finally afer trying several conbinations, I got it....

I did root (hd1,5), checking partition, linux ext2.
then setup (hd1), checking for stage 1, stage2, etc. found!
said some other good stuff too, probably would have been a good idea to write down, but I'm too lazy.....

Then it said grub installed succesfully!

Woohoo!!!!!!!!!!

The only prob now is that the /etc/grub.conf file was refering to (hd0,4) from before, I geuss that's where the old /boot partition was that is longer there anymore? so I changed it to (hd1,5) as that's where it found all the grub stuff....


Rebooted.....

Crossed my fingers, toes, polarity of the planet... lol


Grub finally pops up!... wohoo!!!!

Not only that, but all my entries are all there just lilke before, my two linux kernels, and my windows xp entry.... It boots into winxp like a champ...

It's all in black and white though. I miss the colour grub loader, it looks exactaly the same as far as setup, but I just miss the redhat logo and the nice sky blue it had....

Now for my last major problem....

It still wont boot any of the linux entries, gives error 15, file not found?!?!?!?!?!?!?!?!?!

I tried editing the entry by hitting "e" then trying to muck around with the "root (hd1,5)" and tried different combination then tried to boot again, only with the same error message....


I know after all this work I'm almost there, must be something easy now that I'm at this point... I just want it to boot my linux partitions again! I know there thereeee, and now that grub is finally installed this should hopefully be a simple resolution.

If you guys need anymore info just let me know and I'll try to provide it, as far as partition tables and config captures, soon as I figure out how to capture a cat output or screenshots of a terminal session....

Thanks for the help....


Last edited by deviousdoses; 03-01-2004 at 01:07 PM.
 
Old 03-01-2004, 01:38 PM   #6
DavidPhillips
LQ Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
Did you update the /etc/fstab file on your filesystem to reflect the partition changes?
 
Old 03-01-2004, 01:41 PM   #7
deviousdoses
LQ Newbie
 
Registered: Feb 2004
Posts: 18

Original Poster
Rep: Reputation: 0
fstab

I did add an entry in fstab for /dev/hdd5 /boot, not sure if it's right, going to switch back to linux with resuce cd and have another stab at it...

Thanks again david..
 
Old 03-01-2004, 02:10 PM   #8
deviousdoses
LQ Newbie
 
Registered: Feb 2004
Posts: 18

Original Poster
Rep: Reputation: 0
It's Alive

I'm happy to say that thanx to the help of this forum, I am now writing this message under redhat 8 using netscape.... WohooOO!

I checked the fstab entries, all looked fine, it was just a matter of editing the grub conf file to read hd0,4
instead of hd1,4, had to change this from the boot time, as the config file was incorrect, but after the change now I am back in bussiness, linuxbooted write up without anycomplaints, checked the filesystems, all is good again!

Now if I can just get grub to come up in colour instead of B&W that would rock!, but Im in no hurry to go through that mess again, unless tere is a really simple wasy to switch from text to gui for grub.


Thanks again folks for your assistance, linux users are so helpfull!
 
Old 03-01-2004, 02:21 PM   #9
DavidPhillips
LQ Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
must be the splash image is missing or something like that..

here is the line from my grub.conf

splashimage=(hd0,2)/grub/splash.xpm.gz


my boot partition is on /dev/hda3 that's (hd0,2), the /grub folder is on that partition.

/boot/grub/splash.xpm.gz
 
Old 03-01-2004, 02:48 PM   #10
deviousdoses
LQ Newbie
 
Registered: Feb 2004
Posts: 18

Original Poster
Rep: Reputation: 0
splash image.

It appears that my splash image file is still intact, I just had to tell the grub config file to use graphics mode instead of text, with the command gfxmenu (hd0,4)/message. Now I have my gui or graphical menu back.... Looks like I can change my splash image to be any bitmap file I want, but I like it the way it is, with the redhat logo...


Thanks again for all your help.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
installing grub:( Alexander.s Linux - Software 3 06-04-2005 08:39 PM
Installing my own GRUB - HELP PLEASE!!! stevesk Linux - Software 2 12-17-2004 11:20 AM
Why grub prompt after installing Grub inder Debian woody 3.0r2? velan Debian 1 04-20-2004 04:55 AM
Re-installing XP with grub Rizla Linux - General 1 04-14-2004 07:43 AM
Installing Grub dark_light Linux - General 2 10-09-2002 07:25 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:34 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