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? |
"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. |
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?
|
What else is one hda1, what kind of filesystem is it?
|
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 |
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:
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 |
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? |
All times are GMT -5. The time now is 08:50 AM. |