LinuxQuestions.org
Review your favorite Linux distribution.
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 10-20-2003, 10:42 AM   #1
nathology
LQ Newbie
 
Registered: Oct 2003
Posts: 3

Rep: Reputation: 0
Grub can't find files on (hd0,0)


Hi,

I'm having issues with grub not being able to read off my first hard drive... I've written about 5 million emails to various parties trying to get this solved, so I think I'll just copy one of them instead of writing the 5 million and first description...

"Athena" refers to my school's Red Hat based OS.

>> from a previous email >>
I recently installed Red Hat 9 on the second hard drive of my private
athena workstation. As part of the installation Red Hat installs grub
to allow one to choose between the different OS's that might be on the
machine. I thought I installed grub to the main boot sector of the
first hard drive (which grub calls hd0,0). When the installation
completed, I found grub allowed the new Red Hat OS to boot up
perfectly but I got errors when trying to boot Athena.

I went into the /boot/grub/grub.conf file from Red Hat and adjusted it
so that the athena menu matched what was on hda1. Here's a copy of
that file:

# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You do not have a /boot partition. This means that
# all kernel and initrd paths are relative to /, eg.
# root (hd1,0)
# kernel /boot/vmlinuz-version ro root=/dev/hdb1
# initrd /boot/initrd-version.img
#boot=/dev/hda
default=1
timeout=10
splashimage=(hd1,0)/boot/grub/splash.xpm.gz
title Red Hat Linux (2.4.20-6)
root (hd1,0)
kernel /boot/vmlinuz-2.4.20-6 ro root=LABEL=/ hdc=ide-scsi
initrd /boot/initrd-2.4.20-6.img
title Athena Linux (2.4.20-20.9)
root (hd0,0)
kernel /vmlinuz-2.4.20-20.9 ro root=/dev/hda7
initrd /initrd-2.4.20-20.9.img

But when I reboot and try to boot up Athena, I get a "file not found"
error when grub tries to execute the kernel command. So apparently it
couldn't see file /vmlinuz-2.4.20-20.9. I've tried replacing the file
name with /boot/vmlinuz-2.4.20-20.9, (hd0,0)/vmlinuz-2.4.20-20.9,
(hd0,0)/boot/vmlinuz-2.4.20-20.9, etc, and all I get is "file not
found" errors.

I've been examining the info files and everything that I can find that
makes sense online, and I think I discovered the thing that might be
the problem. If you go into the grub utility from either Red Hat or
from command line options from a grub boot disk, you can use the
"find" command along with command line completion to see what files
grub can see. For example, "find (hd1,0)/" followed by the tab key
will print a possible list of completions like:

grub> find (hd1,0)/
Possible files are: lost+found dev proc .autofsck var tmp etc root usr
boot bin home initrd lib mnt opt sbin misc .fonts.cache-1

These are the files from the /boot directory in my Red Hat root
directory. So using the find command, I can see that grub has no
problem seeing /boot/vmlinuz-2.4.20-6 and /boot/initrd-2.4.20-6.img,
as is required for Red Hat to boot up. If I try to find the files from
the boot directory of hard drive 1, I get the following:

grub> root (hd0,0)/
Error 15: File not found

so it doens't see any of the files on that partition. I know the
partition exists because I can mount /dev/hda1 from Red Hat, it
contains all of the same boot files as /boot, but for Athena instead. In
particular, it contains the vmlinuz-2.4.20-20.9 file that grub can't
seem to find.

Why can't grub read from the first hard drive? Everyone who I've
spoken with at sipb and zephyred on class help seemed to be of the
opinion that there shouldn't be any problem finding the files. Is
there any way to get my Athena OS back short of reinstalling it?
 
Old 10-20-2003, 11:05 AM   #2
aaa
LQ Guru
 
Registered: Jul 2003
Location: VA
Distribution: Slack 10.1
Posts: 2,194

Rep: Reputation: 47
"root (hd0,0)
kernel /vmlinuz-2.4.20-20.9 ro root=/dev/hda7
initrd /initrd-2.4.20-20.9.img"
Your Athena is on /dev/hda7. (hd0,0)=/dev/hda1. Unless your kernel & initrd are on /dev/hda1, you'll have to change your entries. Try this:
kernel (hd0,6)/vmlinuz-2.4.20-20.9 ro root=/dev/hda7
initrd (hd0,6)/initrd-2.4.20-20.9.img
Get rid of the 'root' thing. It can mess up things.
 
Old 10-20-2003, 11:10 AM   #3
nathology
LQ Newbie
 
Registered: Oct 2003
Posts: 3

Original Poster
Rep: Reputation: 0
the kernel and initrd are on hda1, so I'm pretty sure that the grub.conf file is correct in that regard. Are there limitations on where grub can read files from?
 
Old 10-20-2003, 11:11 AM   #4
aaa
LQ Guru
 
Registered: Jul 2003
Location: VA
Distribution: Slack 10.1
Posts: 2,194

Rep: Reputation: 47
What else is one hda1, what kind of filesystem is it?
 
Old 10-20-2003, 11:19 AM   #5
nathology
LQ Newbie
 
Registered: Oct 2003
Posts: 3

Original Poster
Rep: Reputation: 0
ok, if I go into the grub utility from my Red Hat OS and type root (hd0,0), I get this


GRUB version 0.93 (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)
Filesystem type is fat, partition type 0x6

grub>

so I think that answers you file system question... as for what else is in the drive,
here's the directory listing I get after mounting the drive

[root@n2c25 hda1]# ls
boot.b lost+found System.map
chain.b message System.map-2.4.20-20.9
config-2.4.20-20.9 message.ja vmlinux-2.4.20-20.9
grub module-info vmlinuz
initrd-2.4.20-20.9.img module-info-2.4.20-20.9 vmlinuz-2.4.20-20.9
kernel.h os2_d.b
 
Old 10-20-2003, 12:10 PM   #6
coolamit78
Member
 
Registered: Aug 2003
Location: New Delhi, India
Distribution: RHEL AS 3/4, Windows XP
Posts: 546

Rep: Reputation: 31
I have successfully implemented a triple boot an hr back comprising

Win98se
RedHat 9 and
Mandrake 8.2

Now lets take a look at your grub.conf file

Quote:

# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You do not have a /boot partition. This means that
# all kernel and initrd paths are relative to /
, eg.
# root (hd1,0)
I cannot say for sure, but seems like grub is not able to find where your root partition is!

You need to tell grub the location of these boot files with respect to the root directory (/)

So your entry in the grub.conf should look like this

#In case athena is installed on MBR then you should have this

root (hd0,0)

OR

#In case athena is installed on the first sector
#of root partition of athena (which is /dev/hda7) then
# it should be

root (hd0,6)

kernel /vmlinuz-2.4.20-20.9 ro root=/dev/hda7=LABEL=/
initrd /initrd-2.4.20-20.9.img

I think this should work...however, if it dosent, dont lose hope....and wait for a guru to suggest something better.

Regards,

amit
 
Old 10-24-2003, 10:53 AM   #7
aus9
LQ 5k Club
 
Registered: Oct 2003
Location: Western Australia
Distribution: Icewm
Posts: 5,842

Rep: Reputation: Disabled
just to let you know that mbr is (hd0) not (hd0,0)

umm, the grub FIND command is used to find vmlinuz and initrd if its truly hda1 the root command fixes the /boot partition not the / or /root.

working from a fstab file could be misleading so printout your fdisk for /dev/hda and /hdc (or whatever)

assuming /boot is truly found on hda1 with its files vm etc

try

root (hd0,0)
kernel /boot/vmlinuz-2.4.20-20.9 ro root=/dev/hda7
initrd /boot/initrd-2.4.20-20.9.img

now the second root word is / and not /root so fdisk is clearer on where you put stuff. I notice this is or very close to what you tried so you may have to have a look at the spelling you used and the true partiton table?
 
  


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
linux find to find files with multiple patterns subu_s Programming 6 12-15-2010 12:15 AM
grub; hda1 == root(hd0,0) ; hda5 = ???? stupidloser Linux - General 6 12-05-2004 01:26 AM
Grub cannot find the filesystem type of my hd0 drive JimmyGourd Linux - Newbie 9 09-25-2004 12:28 PM
Grub: how to recover Boot Record for (hd0,0)? fishwombat Linux - General 1 04-27-2004 09:43 AM
Unable to find GRUB files? Alinuxnoob Linux - Newbie 0 03-05-2002 10:30 AM

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

All times are GMT -5. The time now is 02:57 AM.

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