1827845 Members
1828 Online
109969 Solutions
New Discussion

Re: GRUB

 
SOLVED
Go to solution
M.Thomas
Frequent Advisor

GRUB

Hi admins,
Iam using RHEL-4 OS , when i power on the system , system is not booting , iam getting GRUB> prompt, i typed boot in GRUB prompt , iam getting following error,
Error-8: Kernel must be loaded before booting , tell me how to solve this
1 REPLY 1
Matti_Kurkela
Honored Contributor
Solution

Re: GRUB

If you get the GRUB> prompt, then something is wrong with the /boot/grub/grub.conf file.

First, we need to find out the GRUB-style name for the disk that contains the /boot/grub directory. Because you got as far as the GRUB prompt, GRUB's stage2 file is probably intact.

Try the following commands:
find /boot/grub/stage2
find /grub/stage2

One or the other of these commands will display a message like
(hd0,0)
The numbers may be different: use the numbers GRUB tells you instead of my 0,0 in the following.

The "find" command told us where the GRUB's stage2 file can be found, in GRUB notation. That partition will need to be selected as GRUB "root" partition: all the future GRUB commands will refer to it. Enter a command like:

root (hd0,0)

using the numbers GRUB reported to you before. This will probably be your /boot partition: the GRUB root partition and Linux root partition are completely different things.

We could try to find the grub.conf file, to see the names of the kernel files. Unfortunately, GRUB does not have a 'ls' command. Try these commands:

cat /boot/grub/grub.conf
cat /grub/grub.conf

One of these should display the GRUB config file, if it's present on the disk. There should be one or more sets of four lines at the end of the file: the first line has the command "title ", then there should be a "root ...", "kernel ..." and "initrd ..." lines.

If everything is OK, the "root" line should match the "root" command you entered earlier.
If you got the grub.conf file displayed, you just need to choose one of the four-line groups in that file and enter the same "kernel" and "initrd" commands as in that group of lines. After that, you can use the "boot" command.

However, it is very likely that the grub.conf file is not available (the lack of it is the reason you are in this situation, after all).
In that case, GRUB's command line completion may help: type
kernel /vmlinuz-
and press TAB instead of Enter. GRUB should list the names of the kernel files available. Pick one of the kernel files and type the rest of the name, but don't press Enter just yet.

The Linux kernel needs a few options added to the GRUB's "kernel" command line. First of these is always "ro" to make the kernel mount the root filesystem initially in a read-only mode (to allow root filesystem to be checked). The next option, "root=" specifies the device name of your Linux root filesystem (*not* the GRUB "root" filesystem).

If your RHEL-4 installation is done using the default partitioning, the complete kernel command line should be exactly like the following, although the vmlinuz version number may be different:

kernel /vmlinuz-2.6.9-22.EL ro root=/dev/VolGroup00/LogVol00

After that, you need the "initrd" command.
Again, type "initrd /initrd-" and press TAB to see the available files, then pick the version number that matches the version in the "kernel" command. Complete the filename and press Enter. Now you can use the "boot" command.

If your /boot partition is more severely damaged, there might not be any usable kernel files available. In that case, boot your system from the installation CD-ROM and use the rescue mode instructions in the CD-ROM's boot prompt.

Finally, when you get to the Linux command prompt (either by booting up the system using GRUB or by using the CD-ROM rescue mode), you need to restore/recreate the GRUB configuration file and the vmlinuz and initrd files, if any of them are missing.
MK