LinuxQuestions.org
Help answer threads with 0 replies.
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 06-16-2006, 09:49 PM   #1
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,687

Rep: Reputation: 55
Grub does not work


Hi folks,

FedoraCore5_64

Grub on this box did not work ever since running "yum update" updating "kernel-2.6.16-1.2133_FC5" a few days ago. On starting the PC only with "GRUB" popup on a black screen without other messages. Typing does not work, keystroke without function. I have to run a boot floppy to start the box/PC.

# uname -a
Code:
Linux localhost.localdomain 2.6.16-1.2133_FC5 #1 SMP Tue Jun 6 00:51:53 EDT 2006 x86_64 x86_64 x86_64 GNU/Linux
# rpm -qa kernel
Code:
kernel-2.6.16-1.2133_FC5
kernel-2.6.16-1.2122_FC5
The boot floppy was created on this box with
Code:
# grub
grub> root (hda0,0)
setup (fd0)

I tried to fix the problem with the boot floppy without success. Steps performed as follows;

# fdisk -l
Code:
Disk /dev/sda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          13      104391   83  Linux
/dev/sda2              14        1734    13823932+  83  Linux
/dev/sda3            1735        3008    10233405   83  Linux
/dev/sda4            3009        9729    53986432+   5  Extended
/dev/sda5            3009        3262     2040223+  82  Linux swap / Solaris
HD - SATA interface
/boot on /dev/sda1


After starting the box/PC with the boot floppy

1)
On Konsole;
# grub
Code:
Probing devices to guess BIOS drives. This may take a long time.

	GNU GRUB  version 0.97  (640K lower / 3072K upper memory)

 [ Minimal BASH-like line editing is supported.  For the first word, TAB
   lists possible command completions.  Anywhere else TAB lists the possible
   completions of a device/filename.]
grub> root (hd0,0)
Code:
root (hd0,0)
 Filesystem type is ext2fs, partition type 0x83
grub> setup (hd0,0)
setup (hd0,0)
Code:
 Checking if "/boot/grub/stage1" exists... no
 Checking if "/grub/stage1" exists... yes
 Checking if "/grub/stage2" exists... yes
 Checking if "/grub/e2fs_stage1_5" exists... yes
 Running "embed /grub/e2fs_stage1_5 (hd0,0)"... failed (this is not fatal)
 Running "embed /grub/e2fs_stage1_5 (hd0,0)"... failed (this is not fatal)
 Running "install /grub/stage1 (hd0,0) /grub/stage2 p /grub/grub.conf "... succeeded
Done.
Exited grub and rebooted the box/PC. Still failed to boot the box/PC with only "GRUB" displayed on a black screen, no other messages. Keystroke did not work.


2)
On Konsole
# grub
Code:
Probing devices to guess BIOS drives. This may take a long time.

	GNU GRUB  version 0.97  (640K lower / 3072K upper memory)

 [ Minimal BASH-like line editing is supported.  For the first word, TAB
   lists possible command completions.  Anywhere else TAB lists the possible
   completions of a device/filename.]
grub> root (fd0)
Code:
root (fd0)
 Filesystem type unknown, using whole disk
grub> setup (hd0,0)
Code:
setup (hd0,0)

Error 17: Cannot mount selected partition
Failed. Whether I need to mount the /boot partition (/dev/sda1) first before running "grub"? The HD is working. Would it make confusion resulting in re-installing the complete FC5_64.


Besides I can't mount the boot floppy, either as root or as user, to copy "grub" from it on /boot

$ cat /etc/fstab
Code:
...
....
/dev/fd0	 /mnt/floppy		auto	noauto,owner,user,kudzu 0 0
However I can mount a floppy with .txt files on it only by running "mount /mnt/floppy"

It looks strange to me. Would the boot floppy only contain an image.

Please advise. TIA


B.R.
satimis
 
Old 06-16-2006, 10:04 PM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 18,996

Rep: Reputation: 3286Reputation: 3286Reputation: 3286Reputation: 3286Reputation: 3286Reputation: 3286Reputation: 3286Reputation: 3286Reputation: 3286Reputation: 3286Reputation: 3286
Go back to the hard disk install - use setup (hd0)
 
Old 06-16-2006, 10:22 PM   #3
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 741Reputation: 741Reputation: 741Reputation: 741Reputation: 741Reputation: 741Reputation: 741
A very long post--hard to follow.
When you upgrade the kernel, you have to edit the grub config file to have the correct kernel name. the config file is typically named "menu.lst" (in /boot/grub)

I'm guessing that commands like "setup" do the same thing, but I have never done it that way.
 
Old 06-16-2006, 10:33 PM   #4
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,687

Original Poster
Rep: Reputation: 55
Hi pixellany,

Quote:
When you upgrade the kernel, you have to edit the grub config file to have the correct kernel name. the config file is typically named "menu.lst" (in /boot/grub)
IIRC when I ran "yum update". It only updated the kernel, no other packages. "yum update" removed the old kernel and edited /boot/grub/grub.conf autotmatically. menu.lst is symlinked to grub.conf on this FC5_64 PC. Everything was not under my control.

# ls -l /boot/grub
Code:
total 205
-rw-r--r-- 1 root root     63 Apr 20 15:15 device.map
-rw-r--r-- 1 root root   7456 May 30 00:18 e2fs_stage1_5
-rw-r--r-- 1 root root   7328 May 30 00:18 fat_stage1_5
-rw-r--r-- 1 root root   6592 May 30 00:18 ffs_stage1_5
-rw------- 1 root root    753 Jun 12 23:36 grub.conf
-rw------- 1 root root    912 May 23 20:39 grub.conf.old_230506
-rw-r--r-- 1 root root   6592 May 30 00:18 iso9660_stage1_5
-rw-r--r-- 1 root root   8032 May 30 00:18 jfs_stage1_5
lrwxrwxrwx 1 root root     11 Apr 20 15:15 menu.lst -> ./grub.conf
-rw-r--r-- 1 root root   6752 May 30 00:18 minix_stage1_5
-rw-r--r-- 1 root root   9056 May 30 00:18 reiserfs_stage1_5
-rw-r--r-- 1 root root   7028 Jun  7 00:56 splash.xpm.gz
-rw-r--r-- 1 root root    512 May 30 00:18 stage1
-rw-r--r-- 1 root root 102332 May 30 00:18 stage2
-rw-r--r-- 1 root root   6944 May 30 00:18 ufs2_stage1_5
-rw-r--r-- 1 root root   6144 May 30 00:18 vstafs_stage1_5
-rw-r--r-- 1 root root   8768 May 30 00:18 xfs_stage1_5
# cat /boot/grub/grub.conf
Code:
....
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title Fedora Core (2.6.16-1.2133_FC5)
        root (hd0,0)
        kernel /vmlinuz-2.6.16-1.2133_FC5 ro root=LABEL=/ rhgb noapic quiet
        initrd /initrd-2.6.16-1.2133_FC5.img
title Fedora Core (2.6.16-1.2122_FC5)
        root (hd0,0)
        kernel /vmlinuz-2.6.16-1.2122_FC5 ro root=LABEL=/ rhgb noapic quiet
        initrd /initrd-2.6.16-1.2122_FC5.img
B.R.
satimis
 
Old 06-16-2006, 10:38 PM   #5
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,687

Original Poster
Rep: Reputation: 55
Hi syg00,

Tks for your advice.

Quote:
Go back to the hard disk install - use setup (hd0)
Now this FC5_64 box can be started with the boot floppy.

Whether you suggested after bootup the box on Konsole or any terminal run "setup" as root;

$ su -
PASSWORD
# setup

TIA

B.R.
satimis
 
Old 06-16-2006, 10:51 PM   #6
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 18,996

Rep: Reputation: 3286Reputation: 3286Reputation: 3286Reputation: 3286Reputation: 3286Reputation: 3286Reputation: 3286Reputation: 3286Reputation: 3286Reputation: 3286Reputation: 3286
From a terminal (as root)
Code:
grub
root (hd0,0)
setup (hd0)
exit
Should do it - although I was under the impression FC offered a rebuild of the loader as an option if you booted the (first) CD in rescue mode.
Note the root directive addresses the partition where the grub stage files exist - the setup line addresses the device; it will (re-)write the MBR loader code.
 
Old 06-18-2006, 05:58 AM   #7
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,687

Original Poster
Rep: Reputation: 55
Hi syg00,

Quote:
From a terminal (as root)
Code:
grub
root (hd0,0)
setup (hd0)
exit
Should do it
Your advice works for me. Problem solved. Tks.

B.R.
satimis
 
Old 06-20-2006, 03:10 AM   #8
lunlun
Member
 
Registered: Jul 2005
Posts: 41

Rep: Reputation: 15
Hi again syg00,


--edit--
I found out my problem, grub-install is installing grub into /mnt/hda3/boot/grub

while my original grub is int /mnt/hda3/grub


so i had to copy my menu.lst from /mnt/hda3/grub into /mnt/hda3/boot/grub
--edit--

Quote:
Originally Posted by satimis
Hi syg00,

Your advice works for me. Problem solved. Tks.

B.R.
satimis

i have a dual boot window and FC5

after i played with grub-install on FC5 (I WAS just trying to use grub-install to install grub on my external harddrive, but somehow i managed to screw up my computer's gruB)

when i reboot, i see lots of "GRUB" and i cannot boot into FC5 nor window.


my /boot partition is on /dev/hda3

so i booted knoppix

mounted hda3
and typed

Code:
grub-install --root-directory=/mnt/hda3 /dev/hda

but now... i just get booted into the grub shell.

So i followed your instructions

root (hd0,2)
setup (hd0) "there are succeed messages"
reboot "since i dont have the exit command"


but when i reboot, i still get booted into the grub shell


Q1: grub can either be installed into mbr or on partition(/boot), right???

Q2: on the command "grub-install", how can i specify whether it will install into mbr or on partition?

(when i did

Code:
grub-install /dev/hda
WHICH i thought will install grub into mbr, it gives me error of "could not find device for /boot: Not found or not a block device)


hmm i probably sound very wrong and am embarrassing myself but i really appreciate you guys' help

Lunlun

Last edited by lunlun; 06-20-2006 at 04:23 AM.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
? grub changes - why it does not work ? ibex Linux - General 7 04-17-2006 09:43 PM
Get GRUB to work Ephracis Linux - Software 3 04-17-2006 07:53 PM
Grub won't work bstopp Linux - Newbie 4 11-11-2004 09:46 AM
commands work with interactive grub, but not in grub.conf richardg Linux - Newbie 2 11-23-2003 04:36 AM
Getting GRUB to work linuxnewbie001 Linux - Software 1 08-01-2003 02:30 PM

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

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