Find the answer to your Linux question:
Results 1 to 7 of 7
Hello, I originally used Slackware back in the day and then Redhat, before it went commercial. My job changed where I mainly had to use AIX, so I haven't been ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jul 2008
    Posts
    5

    Installed CENTOS, rebooted, stuck at grub


    Hello,

    I originally used Slackware back in the day and then Redhat, before it went commercial. My job changed where I mainly had to use AIX, so I haven't been involved in Linux since then. Just getting back into it.

    I installed CentOS 5.1. My Dell system had a partition for Dell utilities - usually I delete this, but this time I did not. I deleted the windows partition and created 1 /boot partition since I am going to use LVM and /boot can not be part of that, 1 swap and then 1 LVM partition using the rest of the disk. Inside the LVM parition, I created a filesystem for /, /var, /home & /user/local

    After install, it wanted me to reboot, so I did. I walked away and when I came back I was booted into Linux. I logged into X and then was prompted about many updates available. I installed some updates. A couple required a reboot. Once I rebooted - this time I stayed in the room - it just came up to a grub prompt.

    I am familar with lilo, but not grub. Anyway, I press enter and just got another grub prompt. I typed "help" to see what all the commands are. I type "boot" and get the error "Error 8: Kernel must be loaded before booting".

    I will continue to do research to see if I can find out what is wrong, but if anyone has any insight, please let me know.

    Thanks in advance,

    --Mike

  2. #2
    Just Joined!
    Join Date
    Jul 2008
    Posts
    5
    BTW, here is the output from fdisk -l when I boot-up with CD into rescue mode:

    fdisk -l

    Device Boot Start End Blocks ID System
    /dev/sdb1 1 12 96358 de Dell Utility
    /dev/sdb2 * 13 25 104422+ 83 Linux
    /dev/sdb3 26 156 1052257 82 Linux swap
    /dev/sdb4 157 30393 242878702 8e Linux LVM

    Also, when I go into my /boot filesystem that during rescue was mounted as /mnt/sysimage/boot and then into the grub subdirectory, I see a symbolic link called menu.lst that points to a file called grub.conf, which evidentally isn't a text file, since I can't view it.

    --Mike

  3. #3
    Linux Guru
    Join Date
    Oct 2007
    Location
    Tucson AZ
    Posts
    3,101
    The file 'grub.conf' is a text file. It is the file you see when you boot (if you can actually boot) with a list of operating system choices. In Fedora and, I expect CentOS, the file 'menu.lst' used in most Linux distros is called grub.conf but the contents and purpose are the same.

    In your /boot directory, you should have files name 'vmlinuz...' and 'initrd...' which are needed to boot the system. Generally, these files are all created during the installation and the 'menu.lst' or 'grub.conf' file contains the stanzas pointing to the kernel. I'm not sure why you can't open the 'grub.conf' file in /boot/grub directory, sound strange as it is nothing but a text file. Did you try to view it as root, as that is necessary. I think it's possible your problem is that one of the updates you did after install was a kernel update which changed the menu entry and grub can't find it.

    Try logging in as root and taking a look at the 'grub.conf' file.
    If you can do this as root, then go to the /boot directory and run: ls -l and post the output (should show vmlinuz and initrd files).

  4. #4
    Just Joined!
    Join Date
    Jul 2008
    Posts
    5
    Thanks for the reply. I was root when I looked at the file. I could open it, but it wasn't text. Try to do a "more" on a binary file and you will see the type of results I got when I tried to vi the file.

    Anyway, I investigated further and found that the file must have been corrupt, because unlike all the other files in that directory when you do a ls -l, instead of showing the normal columns of info this file showed up like:

    ? ? grub.conf

    I ended up deleting the file and then did a "touch grub.conf" to create a blank file. I am now trying to reconfigure grub.

    My current issue is that I haven't found the right syntax. I am expecting it has something to do with root is in a lvm partition (/boot of course is not in lvm) and possibly also because I have a hardware raid setup (I am mirroring the drives). So, my devices have different device names and mappings than the normal examples in the grub manual, which seems to assume a IDE and no raid.

    Has anyone on this forum configured grub when / root is in an lvm? I tried something like: kernel (hd0,1)/vmlinuz-2.6.18-58.1.6.el5xen ro root=/dev/vg1/lv0

    BTW, I found it strange that when I do a find /grub/stage1, it returned (hd0,1), but when you do an fdisk -l, the drives show up with SCSI identifiers (i.e. sdb1, sdb2, etc..)

    Anyway, lv0 is the "/" filesystem in my lvm partition, which I renamed vg1 instead of using the linux default names which are way to long for my taste. The results are that it complains about the format. I did some tests with autocomplete and it doesn't even seem to know about the /dev.

    I am starting to wonder if I should also make the /dev a filesystem outside of LVM. Maybe grub would see it then and stop complaining about the format.

    --Mike

  5. #5
    Linux Guru
    Join Date
    Oct 2007
    Location
    Tucson AZ
    Posts
    3,101
    Here's a link on the forums with a solution to a similar problem. Don't know if it will help in your situation, it's a pretty old link, but...?

    http://www.linuxforums.org/forum/red...t-problem.html

    Grub uses a different naming convention than Linux so that sda in Linux = hdo in Grub and sda1 = (hd0,1). With Grub you need the () and the comma before the partition number. Did you find your vmlinuz and initrd files? Haven't got any further suggestions as I have never used LVM. Good Luck.

  6. #6
    Just Joined!
    Join Date
    Jul 2008
    Posts
    5
    Yes, I had no problem finding my vmlinuz and initrd files. They were in the boot filesystem as expected. So, if I can just figure out what syntax it is wanting, hopefully it will boot.

    Thanks for the link and the info. I'll try changing my syntax to:

    kernel (hd0,1)/vmlinuz-2.6.18-58.1.6.el5xen ro root=(hd0,4)/dev/vg1/lv0

    and see if that works.

    Thanks again for your help.

    --Mike

  7. #7
    Just Joined!
    Join Date
    Jul 2008
    Posts
    5
    I decided to re-install to find out what caused the problem in the first place. After installing CentOS 5.1 again, there was a list of 200+ updates available when I logged in. This time I went through them more catiously and only selected updates that I thought would NOT cause me an issue. That left about 6 or so. I made backups of my kernel and grub.conf files and then did those updates one at a time. After which I kept verifying that my grub.conf was not blank or currupted.

    The two packages I left for last was a grub package and a kernel package. I chose to leave the kernel package for last. It was the kernel package that caused the issue. Once I installed it, my grub.conf was again corrupt - acting like it was binary file, instead of text. I just copied back my grub.conf file to solve the issue. I also looked it over closely to find out what syntax error I previously had when I tried to recreate it manually.

    If anyone is interested the exact package name that caused my original issues is:

    kernel-headers-2.6.18.el5.x86_64

    --Mike

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •