LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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 04-24-2005, 06:45 PM   #1
0perat0r
Member
 
Registered: Jul 2004
Location: New Jersey, US
Distribution: Red Hat Linux WS version 3
Posts: 126

Rep: Reputation: 15
reinstalling GRUB


It seems my GRUB install is no longer reliable. It freezes during Stage 2 on boot up. I think a reinstall os necessary. Would someone please tell me how to reinstall GRUB from Linux?

Thanks
 
Old 04-24-2005, 07:09 PM   #2
masonm
Senior Member
 
Registered: Mar 2003
Location: Following the white rabbit
Distribution: Solus
Posts: 2,254

Rep: Reputation: 47
Well you should be able to restore your bootloader from your original install CD.

I'm curious what makes you think Grub is the problem as opposed to something else?
 
Old 04-24-2005, 07:12 PM   #3
freakyg
Member
 
Registered: Apr 2005
Distribution: LFS 5.0 and 6.1
Posts: 705

Rep: Reputation: 30
I boot with grub, but I use a floppy.........stage 2 has gone bad once or twice.........to fix it I just make a new floppy..........
Code:
dd if=/boot/grub/stage1 of=/dev/fd0 bs=512 count=1
dd if=/boot/grub/stage2 of=/dev/fd0 bs=512 seek=1
 
Old 04-24-2005, 07:24 PM   #4
0perat0r
Member
 
Registered: Jul 2004
Location: New Jersey, US
Distribution: Red Hat Linux WS version 3
Posts: 126

Original Poster
Rep: Reputation: 15
masonm, I have been having problems with this for some time. I turn on the PC, and sometimes it gets past Stage 2, and other times it does not. There seems to be no ryme or reason to when it decides to freeze the boot process at this point. I can press the reboot button on my PC and get past it. I have done a little research, and have entertained that the problem was a) the BIOS, but I cannot find any real problems when I enter the BIOS setup, or b) that GRUB cannot "see" the disks during the boot process. This could mean that GRUB cannot calculate the goemetry of the disks, implying some hardware issue with the disks, or that GRUB was never really healthy to begin with. I am running a dula-boot Win XP and RH WS 3. Any insight is appreciated, and thanks for the help so far.
 
Old 04-25-2005, 06:22 AM   #5
harken
Member
 
Registered: Jan 2005
Location: Between the chair and the desk
Distribution: Debian Sarge, kernel 2.6.13
Posts: 666

Rep: Reputation: 30
Look here: http://www.gnu.org/software/grub/man...l#Installation If you have one, you may use a LiveCD (such as Knoppix or its derivatives, whatever suits you), mount the partition containing your Linux kernel, chroot into it and reinstall from there. For example, if your RH install is on the 2nd HD, 1st partition, try
Code:
mkdir /mnt/RHinstall
mount /dev/hdb1 /mnt/RHinstall
chroot /mnt/RHinstall /bin/bash
grub-install /dev/hda
exit
umount /dev/hdb1
Or, if you can reach a grub command line, follow the instructions from the link above, paragraph "Installing GRUB natively".
 
Old 04-25-2005, 04:34 PM   #6
0perat0r
Member
 
Registered: Jul 2004
Location: New Jersey, US
Distribution: Red Hat Linux WS version 3
Posts: 126

Original Poster
Rep: Reputation: 15
I was able to reinstall GRUB from a terminal session using the "grub-install /dev/hda" command. Since doing so (yesturday), the problem has not repeated itself, nor do I see the "GRUB error loading Stage 2" message during the verbose booting process. I used to see this message flash by just before the GRUB graphical screen came on, or at the point where the boot process froze. Now it simply says something like "GRUB is now loading" for a second before I see the GRUB screen with the OS choices. I hope this is the fix, as this problem had been occurring for months and was really quite annoying. I had troubleshooted everything from it being the IDE cable (bought a better one anyway) to there being an actual physical problem with one or both of the drives. I entertained using "fixmbr" from Windoze recovery as a solution, but I really did not want to loose Linux. Thanks again, everyone.
 
Old 05-02-2005, 02:21 PM   #7
0perat0r
Member
 
Registered: Jul 2004
Location: New Jersey, US
Distribution: Red Hat Linux WS version 3
Posts: 126

Original Poster
Rep: Reputation: 15
OK, so I reinstalled GRUB twice and am still getting errors. The new error is Error 21 and occurs during Stage 1.5. There is a general lack of information available about Error 21 the "unkown error". I finally got sick of GRUB errors, and would like to boot Linux only from a floppy. I have created a GRUB boot floopy using the instructions posted in this thread. It seems to have worked, as I get to the grub> prompt when booting from the floppy. At this prompt, I'm a littel lost about what to do next. My guess is that I have to type in the kernel command and location, as it is specified in the original grub.conf file in the /etc directory on my hard disk. The kenel name and command is rather long, and I would like the booting to happen automatically instead of my (presumably) typing it in. Is there some file on the new floppy I must alter? Should I copy my grub.conf to the floppy and modify it to take out Windows. If all goes well, I plan to use fixmbr and/or fixboot to reinstate the Windows boot loader. I'd like to have the Linux part squared away before I try anything like that. Thanks for all your assistance so far, and thanks in advance for answering my new questions.
 
Old 05-02-2005, 03:30 PM   #8
0perat0r
Member
 
Registered: Jul 2004
Location: New Jersey, US
Distribution: Red Hat Linux WS version 3
Posts: 126

Original Poster
Rep: Reputation: 15
I was able to boot my Linux OS from the grub> prompt. The contents of the grub.conf, which is copied to the floppy during the creation of the boot floppy , is as follows:

# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd1,0)
# kernel /vmlinuz-version ro root=/dev/hdb2
# initrd /initrd-version.img
#boot=/dev/hda
default=1
timeout=10
splashimage=(hd1,0)/grub/splash.xpm.gz
title Red Hat Enterprise Linux WS (2.4.21-15.0.4.EL)
root (hd1,0)
kernel /vmlinuz-2.4.21-15.0.4.EL ro root=LABEL=/ hdd=ide-scsi
initrd /initrd-2.4.21-15.0.4.EL.img
#title Red Hat Enterprise Linux WS (2.4.21-15.0.3.EL)
# root (hd1,0)
# kernel /vmlinuz-2.4.21-15.0.3.EL ro root=LABEL=/ hdd=ide-scsi
# initrd /initrd-2.4.21-15.0.3.EL.img
#title Red Hat Enterprise Linux WS (2.4.21-4.EL)
# root (hd1,0)
# kernel /vmlinuz-2.4.21-4.EL ro root=LABEL=/ hdd=ide-scsi
# initrd /initrd-2.4.21-4.EL.img
title DOS
rootnoverify (hd0,0)
chainloader +1

Note that I have commented out some of the old entries, which are previous kernels that are installed. By entering the following commands at the grub> prompt, I was able to boot into Linux from the floppy, as desired:

root (hd1,0)
kernel /vmlinuz-2.4.21-15.0.4.EL ro root=LABEL=/ hdd=ide-scsi
initrd /initrd-2.4.21-15.0.4.EL.img

I am happy that it actually worked, but I'd like this to happen automatically from the floppy, as mentioned. Any help is appreciated, thanks.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
reinstalling grub. greythorne Ubuntu 23 12-03-2005 02:51 AM
GRUB not reinstalling jboo Linux - Software 5 10-02-2005 11:55 AM
Reinstalling grub darkangel29 Linux - Newbie 3 04-03-2005 06:53 PM
reinstalling grub ELconkestador Linux - Software 1 02-12-2005 11:22 PM
Reinstalling GRUB Petelow Linux - Newbie 1 05-24-2004 05:03 AM


All times are GMT -5. The time now is 03:46 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration