LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   GRUB 0.97 Defaults to Command Line (RHEL 6) (https://www.linuxquestions.org/questions/linux-software-2/grub-0-97-defaults-to-command-line-rhel-6-a-4175438680/)

alpo85 11-25-2012 03:10 PM

GRUB 0.97 Defaults to Command Line (RHEL 6)
 
All,

GRUB Legacy seems to be unable to locate and load the "/boot/grub/menu.lst" configuration file. Loading the menu.lst file must be done on each boot manually with the command:

Code:

configfile /grub/grub.conf
Of note, I have a separate /boot partition and installed GRUB with
Code:

grub-install --root-directory=/boot /dev/sda
Also, many users appear to suggest the setup command will resolve the issue if implemented as such:
Code:

root (hd0,2)
setup (hd0)

Unfortunately, this no workie for me.

Here's my menu.lst file:
Code:

# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,3)
#          kernel /vmlinuz-version ro root=/dev/mapper/vg_alpo-lv_root
#          initrd /initrd-[generic-]version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,2)/grub/splash.xpm.gz

title Red Hat Enterprise Linux 6.1
        root (hd0,2)
        kernel /vmlinuz-2.6.32-131.6.1.el6.x86_64 ro root=/dev/mapper/vg_alpo-lv_root rd_LVM_LV=vg_alpo/lv_root rd_LVM_LV=vg_alpo/lv_swap rd_NO_LUKS rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us crashkernel=auto rhgb quiet
        initrd /initramfs-2.6.32-131.6.1.el6.x86_64.img
title Windows 7
        rootnoverify (hd0,0)
        chainloader +1

Here's my "sudo fdisk -l /dev/sda" output:
Code:

[Alpo@alpo-computer ~]$ sudo fdisk -l /dev/sda

Disk /dev/sda: 750.2 GB, 750156374016 bytes
255 heads, 63 sectors/track, 91201 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0xde4b5a83

  Device Boot      Start        End      Blocks  Id  System
/dev/sda1  *          1          13      102400    7  HPFS/NTFS
Partition 1 does not end on cylinder boundary.
/dev/sda2              13      28733  230690816    5  Extended
Partition 2 does not end on cylinder boundary.
/dev/sda3          65641      65705      512000  83  Linux
/dev/sda4          65705      91202  204800000  8e  Linux LVM
/dev/sda5              14      10457    83886080    7  HPFS/NTFS
/dev/sda6          10457      27428  136315904    7  HPFS/NTFS
/dev/sda7          27428      28733    10485760    7  HPFS/NTFS

Interestingly enough, the menu.lst item says,
Code:

# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,3)

Thus "root (hd0,3)" is specified whereas each OS is called using "root (hd0,2)." Perhaps a mismatch in GRUB vs. the system's partition table?

At any rate, how can I get GRUB to automatically find "menu.lst" and load the menu interface (rather than the command interface) on each boot?

Thanks in advance for the help.

yancek 11-25-2012 06:18 PM

Quote:

Unfortunately, this no workie for me.
Details. "no workie" doesn't tell us a lot. Usually there is some output when you enter those commands at the grub prompt, success or an error reported?

You could go to the site below and download and run the bootinfoscript and review the output (a results.txt file) or post it here as it will give detailed information on your partitions and boot files:

http://sourceforge.net/projects/bootinfoscript/

alpo85 11-25-2012 06:19 PM

Not sure what happened to the grub.conf file, but it seemed to have been stuck in the swap partition. Upon trying to edit menu.lst with "sudo vi /boot/grub/menu.lst", I got:
Code:

E325: ATTENTION
Found a swap file by the name "/boot/grub/.grub.conf.swp"
          owned by: root  dated: Sun Nov 25 18:17:26 2012
        file name: /boot/grub/menu.lst
          modified: no
        user name: root  host name: alpo-computer
        process ID: 3047 (still running)
While opening file "/boot/grub/menu.lst"
            dated: Sun Nov 25 10:58:52 2012

(1) Another program may be editing the same file.
    If this is the case, be careful not to end up with two
    different instances of the same file when making changes.
    Quit, or continue with caution.

(2) An edit session for this file crashed.
    If this is the case, use ":recover" or "vim -r /boot/grub/menu.lst"
    to recover the changes (see ":help recovery").
    If you did this already, delete the swap file "/boot/grub/.grub.conf.swp"
    to avoid this message.
"/boot/grub/menu.lst" 20L, 865C

I rm'd .grub.conf.swp and .grub.conf.swo and re-installed GRUB with:
Code:

#grub-install --recheck /dev/sda
Viola! System workie, menu interface intact.

alpo85 11-25-2012 06:23 PM

Quote:

Originally Posted by yancek (Post 4836872)
Details. "no workie" doesn't tell us a lot. Usually there is some output when you enter those commands at the grub prompt, success or an error reported?

You could go to the site below and download and run the bootinfoscript and review the output (a results.txt file) or post it here as it will give detailed information on your partitions and boot files:

http://sourceforge.net/projects/bootinfoscript/

@yancek, I ran the normal setup commands, but I wouldn't get any errors - it seemed to install normally. I'll be more specific regarding errors/output in future posts; thanks for the feedback. I'll check out your recommendations.

Thanks for the reply!

yancek 11-25-2012 10:27 PM

Quote:

but it seemed to have been stuck in the swap partition
The error you report above happens when an editing session in vi crashes or isn't saved/closed properly for whatever reason. The steps you took are the normal remedy for the problem, at least in my experience.


All times are GMT -5. The time now is 10:19 AM.