LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-22-2003, 09:23 AM   #1
DJSpaceMouse
LQ Newbie
 
Registered: May 2003
Location: /usa/pa/ambridge/home/upstairs
Distribution: Red Hat Linux 9
Posts: 24

Rep: Reputation: 15
Exclamation Need help repairing GRUB! Please!


I resized some partitions today and now GRUB isn't booting Linux properly. When I try, I just get the word "GRUB" at the top of the screen and nothing happens after that. Can alyone tell me what I have to do to repair it?

If it matters, I have a 100MB /boot partition (/dev/hdb1).
 
Old 05-22-2003, 10:41 AM   #2
dorian33
Member
 
Registered: Jan 2003
Location: Poland, Warsaw
Distribution: LFS, Gentoo
Posts: 591

Rep: Reputation: 32
post results of fdisk -l and the grub.conf.
 
Old 05-22-2003, 08:06 PM   #3
DJSpaceMouse
LQ Newbie
 
Registered: May 2003
Location: /usa/pa/ambridge/home/upstairs
Distribution: Red Hat Linux 9
Posts: 24

Original Poster
Rep: Reputation: 15
As you requested...

fdisk -l
Disk /dev/hda: 46.1 GB, 46103371776 bytes
255 heads, 63 sectors/track, 5605 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 1 7 56196 1b Hidden Win95 FAT32
/dev/hda2 * 8 5605 44965903+ 7 HPFS/NTFS

Disk /dev/hdb: 40.0 GB, 40020664320 bytes
255 heads, 63 sectors/track, 4865 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hdb1 * 1 14 112423+ 83 Linux
/dev/hdb2 15 3202 25607610 83 Linux
/dev/hdb3 3203 3333 1052257+ 82 Linux swap
/dev/hdb4 3334 4865 12305790 c Win95 FAT32 (LBA)

grub.conf
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/hdb1
default=0
timeout=10
splashimage=(hd1,0)/grub/splash.xpm.gz
title Red Hat Linux (2.4.20-13.9)
root (hd1,0)
kernel /vmlinuz-2.4.20-13.9 ro root=LABEL=/
initrd /initrd-2.4.20-13.9.img


Thank you very much!
 
Old 05-23-2003, 12:05 AM   #4
yowwww
Member
 
Registered: Apr 2003
Location: Ontario, Canada
Distribution: Arch Linux
Posts: 533

Rep: Reputation: 30
see this site on grub:

http://www.geocities.com/cyberkabila/main/grub.htm
 
Old 05-23-2003, 10:26 AM   #5
DJSpaceMouse
LQ Newbie
 
Registered: May 2003
Location: /usa/pa/ambridge/home/upstairs
Distribution: Red Hat Linux 9
Posts: 24

Original Poster
Rep: Reputation: 15
Thanks for the reply.

I took a good look at the webpage you hyperlinked; however, it still isn't working even after a reinstall of GRUB (grub-install).

I wrote myself a /etc/lilo.conf file and installed LILO instead, and this seems to be working. It's not the way I wanted to fix the problem, but it'll do for now. At least I don't have to boot with a floppy and I have my GUI back. I couldn't boot into a GUI with my floppy because the Linux kernel on the floppy was older and my video driver was compiled for 2.4.20-13.9
 
Old 05-23-2003, 01:50 PM   #6
dorian33
Member
 
Registered: Jan 2003
Location: Poland, Warsaw
Distribution: LFS, Gentoo
Posts: 591

Rep: Reputation: 32
is it still a problem of after successfull LILO install you see it as fixed?
 
Old 05-23-2003, 02:07 PM   #7
DJSpaceMouse
LQ Newbie
 
Registered: May 2003
Location: /usa/pa/ambridge/home/upstairs
Distribution: Red Hat Linux 9
Posts: 24

Original Poster
Rep: Reputation: 15
Basically, I've successfully fixed the symptom, but haven't properly diagnosed the problem.

After installing LILO, RHL boots just fine. Oddly enough, however, I tried to reinstall GRUB again (after LILO was installed and working). I figured one of two things would happen at that point: one, GRUB works properly and boots Linux, or two, GRUB doesn't work and doesn't boot Linux. I never thought that option number three would occur: LILO still boots Linux. I don't get it. I'm pretty sure I was installing GRUB correctly with

grub-install --root-directory=/boot /dev/hdb

but it still didn't work. Oh well. Screw it at this point. LILO is working, Linux is booting, and I am happy.
 
Old 05-23-2003, 03:10 PM   #8
dorian33
Member
 
Registered: Jan 2003
Location: Poland, Warsaw
Distribution: LFS, Gentoo
Posts: 591

Rep: Reputation: 32
I assume that when you are getting grub boot fail (as you described ar your 1st post) the grub prompt ('grub>') is not available (booting process freezes). I got the same when I pointed improper root partition for grub.
 
Old 05-23-2003, 04:23 PM   #9
DJSpaceMouse
LQ Newbie
 
Registered: May 2003
Location: /usa/pa/ambridge/home/upstairs
Distribution: Red Hat Linux 9
Posts: 24

Original Poster
Rep: Reputation: 15
Nope. Black screen, with one word on it in white: GRUB. No prompt. Nothing. Nada. Nichts. Rien. (sorry, I don't know the word for "Nothing" in Polska).
 
Old 05-23-2003, 06:07 PM   #10
dorian33
Member
 
Registered: Jan 2003
Location: Poland, Warsaw
Distribution: LFS, Gentoo
Posts: 591

Rep: Reputation: 32
What can I say...
In such case you may prepare boot diskette with grub (see 'info grub -> Installation -> Creating a GRUB boot floppy' for details). It'll allow you to boot grub. You'll see the grub prompt.
Next it will be possible to type in grub commands instead of using grub.conf. So you may check a lot of combinations of 'root....', 'kernel....' etc commands. Anyone has to do. The found commands parameters should be used in grub.conf

I have also two doubts concerning your current grub configuration:
1. why you use 'grub-install --root-directory=/boot /dev/hdb' instead of 'grub-install --root-directory=/boot /dev/hda' ? Is hdb bootable in any way (BIOS setup, Windows driven boot)?
2. I'm not using initrd file so I'm not sure it requires recreating after changes you have made. I think you may just comment this line for the trials.

BTW: Nothing is Nic in my language (pronounced 'nitz' :)
 
Old 05-23-2003, 06:17 PM   #11
DJSpaceMouse
LQ Newbie
 
Registered: May 2003
Location: /usa/pa/ambridge/home/upstairs
Distribution: Red Hat Linux 9
Posts: 24

Original Poster
Rep: Reputation: 15
There is a reason that I'm attempting to install GRUB to /dev/hdb.

I am a Linux newbie. I will be for some time. When I made the decision to install Linux, I unfortunately couldn't just drop my Windoze crutch. So I went out and bought a 40GB drive to install Linux on instead of partitioning the hell out of my existing drive.

Then I thought, "Hey, I'm going to need some way of selecting which OS to boot." So I got a hacked copy of PowerQuest's PartitionMagic and BootMagic. I installed BootMagic on C: (oops, er, I mean, um, /dev/hda, heh heh) then installed Linux on /dev/hdb (the new drive). I hadn't realized that Linux would come with a boot selector like GRUB or LILO (more precisely, I had never even heard of GRUB or LILO) and didn't realize that they would do the same exact thing as BootMagic.

I get VERY scared when I have to overwrite an MBR, especially on the drive that contains the sum of everything I've ever done computer-wise in my being, so I just left BootMagic alone and installed my Linux boot manager to /dev/hdb.

<big breath>

How much of that made sense? "Nic"?
 
Old 05-24-2003, 05:18 AM   #12
dorian33
Member
 
Registered: Jan 2003
Location: Poland, Warsaw
Distribution: LFS, Gentoo
Posts: 591

Rep: Reputation: 32
It makes sense.
So I see that the booting process starts with Bootmagic. You next choose the OS (Win or Linux), yeah?
I do not know the BootMagic so below info are only my suspicious & doubts :)
I am wondering BootMagic is able to boot MBR from the second drive.
The typical boot loaders are starting from the MBR of first drive (see note below) and next (second stage of boot) give the control of the OS-dependent bootloader located inside chosen OS partition (located usually on 1st sector of OS partition).
So being you I would rather try:
grub-install --root-directory=/boot /dev/hdb1 ---not hdb

You can also try the following:
1)
-enter setup BIOS
-disable first harddrive
-try boot

2)
-enter setup BIOS
-choose the second drive as first boot device
-try boot

--note--
using p (2) you can set the MBR of second drive to act as the fist stage boot, so the Bootmagic should not take part in boot
if it works you can next modify grub.conf to get Windows booted
 
Old 05-24-2003, 11:23 AM   #13
DJSpaceMouse
LQ Newbie
 
Registered: May 2003
Location: /usa/pa/ambridge/home/upstairs
Distribution: Red Hat Linux 9
Posts: 24

Original Poster
Rep: Reputation: 15
That worked, my friend. Your command

grub-install --root-directory=/boot /dev/hdb1

was what I needed. May the Penguin deliver you many tidings of great joy.


One oddity here, though - the files necessary for booting (vmlinuz, initrd, stage*, menu.lst, grub.conf, etc.) were located in /boot/grub. Now they're in /boot/boot/grub.

After reinstalling GRUB with your aforementioned command and rebooting, I was presented with a grub> prompt, which indicated to me that GRUB couldn't locate the grub.conf file. So I rebooted from floppy and noticed a /boot/boot/grub directory. I copied the menu.lst symlink, the grub.conf file, and the splash.xpm.gz file from /boot/grub to the new directory and GRUB booted just fine.

It looks to me that the reinstallation was relative to /boot and not root. Should I try again without the --root-directory=/boot switch?
 
Old 05-24-2003, 12:33 PM   #14
dorian33
Member
 
Registered: Jan 2003
Location: Poland, Warsaw
Distribution: LFS, Gentoo
Posts: 591

Rep: Reputation: 32
Of course you should try 'grub-install --root-directory=/ dev/hdb1' instead. Experiments are the way for knowledge :)
Sorry I've never done 'grub-install'. I've always used grub command line for installing grub.
 
Old 05-25-2003, 09:23 AM   #15
DJSpaceMouse
LQ Newbie
 
Registered: May 2003
Location: /usa/pa/ambridge/home/upstairs
Distribution: Red Hat Linux 9
Posts: 24

Original Poster
Rep: Reputation: 15
That was it. GRUB is now looking in /boot/grub for the files it needs instead of /boot/boot/grub.

I certainly agree that experimentation is way to knowledge. However, as I mentioned earlier, I do NOT like to experiment on the MBR of a hard drive.

Thanks so much for all your help. This was one of the reasons that I decided to move over to Linux - because I knew that when I had a problem, one or more friendly, helpful, established members of the Linux community would come to my rescue as you have done. I can only hope that someday I'll be one of the people answering the questions instead of asking them.
 
  


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
urgent help needed fir repairing grub loader testuserx Linux - General 11 05-06-2005 01:18 PM
Repairing KDE 3.3? msie02 Fedora 1 10-17-2004 01:23 AM
Repairing the MBR artistikone Linux - Hardware 3 06-26-2004 06:13 PM
repairing GRUB deardron Linux - Software 5 12-29-2003 04:11 PM
Repairing? cjnkns Linux - Hardware 4 03-19-2003 07:25 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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