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 01-25-2012, 09:53 AM   #1
MALDATA
Member
 
Registered: Mar 2005
Posts: 157

Rep: Reputation: 19
Grub is not reading its configuration file


Changes to my /boot/grub/grub.conf file are not being shown in the grub menu on a reboot.

I installed a new kernel (3.1.6), and I can't boot to it because it's not in the grub menu... I added it to grub.conf as I always do when I install a new kernel, but it's not shown as an option. My old options are still there, and they work as usual, but I can't change anything. For example, if I change the name of an existing line in grub.conf, that change is not reflected in the grub menu either (e.g., if I change "Windows XP Pro" to "TEST", it still shows up in grub as "Windows XP Pro").

Somehow, grub is loading the options for its menu, but it's definitely not getting them from the grub.conf file.

Perhaps more distressing is the fact that, if I manually change a kernel line to boot the new kernel, it claims that the file isn't there (it is... I installed it the same way I installed every other kernel). I assume that's a symptom of the same problem.

Anyone know why this could be happening?

For your reference:
Code:
$ ls -l /boot
total 35330
-rw-r--r-- 1 root root 2391935 Sep 20 18:51 System.map-2.6.39-gentoo-r3
-rw-r--r-- 1 root root 2391572 Jul 21 22:40 System.map-2.6.39-gentoo-r3.old
-rw-r--r-- 1 root root 2539064 Dec  1 21:55 System.map-3.0.6-gentoo
-rw-r--r-- 1 root root 2593916 Jan 19 19:04 System.map-3.1.6-gentoo
-rw-r--r-- 1 root root 2593916 Jan  8 22:44 System.map-3.1.6-gentoo.old
lrwxrwxrwx 1 root root       1 Jun 25  2009 boot -> .
-rw-r--r-- 1 root root   87790 Sep 20 18:51 config-2.6.39-gentoo-r3
-rw-r--r-- 1 root root   85912 Jul 21 22:40 config-2.6.39-gentoo-r3.old
-rw-r--r-- 1 root root   88570 Dec  1 21:55 config-3.0.6-gentoo
-rw-r--r-- 1 root root   89989 Jan 19 19:04 config-3.1.6-gentoo
-rw-r--r-- 1 root root   89989 Jan  8 22:44 config-3.1.6-gentoo.old
drwxr-xr-x 2 root root    1024 Jan  8 22:44 grub
drwx------ 2 root root   12288 Jun 25  2009 lost+found
-rw-r--r-- 1 root root 4554576 Sep 20 18:51 vmlinuz-2.6.39-gentoo-r3
-rw-r--r-- 1 root root 4552976 Jul 21 22:40 vmlinuz-2.6.39-gentoo-r3.old
-rw-r--r-- 1 root root 4613664 Dec  1 21:55 vmlinuz-3.0.6-gentoo
-rw-r--r-- 1 root root 4662752 Jan 19 19:04 vmlinuz-3.1.6-gentoo
-rw-r--r-- 1 root root 4662752 Jan  8 22:44 vmlinuz-3.1.6-gentoo.old
Here's my grub.conf... after installing 3.1.6, I added the new lines to the top, but only the 3.0.6, 2.6.39, and Windows lines show up in the grub menu.
Code:
$ cat /boot/grub/grub.conf
# This is a sample grub.conf for use with Genkernel, per the Gentoo handbook
# http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=1&chap=10#doc_chap2
# If you are not using Genkernel and you need help creating this file, you
# should consult the handbook. Alternatively, consult the grub.conf.sample that
# is included with the Grub documentation.

# default starts indexing at 0
default 0
timeout 5
#splashimage=(hd0,0)/boot/grub/splash.xpm.gz

#title Gentoo Linux 2.6.30a
#root (hd0,1)
#kernel /boot/kernel-2.6.30a real_root=/dev/md3
#initrd /boot/initramfs-genkernel-x86-2.6.24-gentoo-r5

title Gentoo Linux 3.1.6-gentoo
root (hd0,1)
kernel /boot/vmlinuz-3.1.6-gentoo real_root=/dev/md3 ramdisk_size=128000

title Gentoo Linux 3.0.6-gentoo
root (hd0,1)
kernel /boot/vmlinuz-3.0.6-gentoo real_root=/dev/md3 ramdisk_size=128000

title Gentoo Linux 2.6.39-gentoo-r3
root (hd0,1)
kernel /boot/vmlinuz-2.6.39-gentoo-r3 real_root=/dev/md3 ramdisk_size=128000

title Windows XP Pro
rootnoverify (hd0,0)
makeactive
chainloader +1

# vim:ft=conf:
 
Old 01-25-2012, 10:02 AM   #2
andrewthomas
Senior Member
 
Registered: May 2010
Location: Chicago Metro
Distribution: Arch, Gentoo, Slackware
Posts: 1,690

Rep: Reputation: 312Reputation: 312Reputation: 312Reputation: 312
what is the output of

Code:
emerge -pv grub
 
Old 01-25-2012, 12:59 PM   #3
MALDATA
Member
 
Registered: Mar 2005
Posts: 157

Original Poster
Rep: Reputation: 19
Code:
$ emerge -pv grub

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R    ] sys-boot/grub-0.97-r10  USE="ncurses -custom-cflags -netboot -static" 55 kB

Total: 1 package (1 reinstall), Size of downloads: 55 kB
 
Old 01-25-2012, 10:05 PM   #4
JESSEJJ89
Member
 
Registered: Dec 2011
Location: North America
Distribution: Gentoo
Posts: 50

Rep: Reputation: 5
Did you use genkernel ? Or was the kernel manually configured ?
 
Old 01-25-2012, 11:50 PM   #5
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
The symptoms suggest GRUB is using an old menu.lst.

AIUI (not sure and writing about legacy GRUB not GRUB2), when GRUB is installed to the MBR, GRUB stage 1.5 is installed in the space after the partition table including a fixed offset to the partition containing the file system containing the GRUB directory, /boot/grub. If that has changed and GRUB has not been re-installed, GRUB will continue to load from the old /boot/grub (which could be in empty space on the HDD). GRUB can be re-installed using grub-install.
 
Old 01-26-2012, 02:40 AM   #6
CollieJim
Member
 
Registered: Mar 2005
Distribution: Gentoo, Kubuntu
Posts: 582

Rep: Reputation: 28
If you have more than one linux distro installed, make sure you are updating grub in the right one. If not, your changes will be ignored.
 
Old 01-26-2012, 07:36 AM   #7
MALDATA
Member
 
Registered: Mar 2005
Posts: 157

Original Poster
Rep: Reputation: 19
Quote:
Did you use genkernel ? Or was the kernel manually configured ?
Manual. I did the same thing I've been doing for a couple years, though...

Quote:
If that has changed and GRUB has not been re-installed, GRUB will continue to load from the old /boot/grub (which could be in empty space on the HDD). GRUB can be re-installed using grub-install.
I did try re-running grub-install, but it didn't change anything.

Quote:
If you have more than one linux distro installed, make sure you are updating grub in the right one. If not, your changes will be ignored.
Nope, just the one gentoo installation.
 
Old 02-09-2012, 10:08 AM   #8
MALDATA
Member
 
Registered: Mar 2005
Posts: 157

Original Poster
Rep: Reputation: 19
I figured out what was happening, but I don't quite understand the behavior.

My /boot partition is a software raid1. But when I took a look at cat /proc/mdstat (mostly because I was in the "wild guessing" phase of diagnosis), only one of the two drives was listed in /dev/md1. It wasn't that one device had failed... it just wasn't there at all. I have no idea what happened. So I had to do

Code:
# mdadm --add /dev/md1 /dev/sda2
to add the other drive back in, it synced them up, and then all of a sudden, everything was cool.

So my questions now are as follows:
- Why would a drive just get booted out of a raid array, and is there something I should have been doing to keep an eye on it?
- Why would that cause grub to not read the contents of a file which, while on a broken array, still held the correct information?
- Was it just trying to run grub from /dev/sda, which wasn't being written to because it wasn't in the array? If so, say that /dev/sda actually DOES fail at some point. The whole reason I made /boot a raid1 array was so that I'd still be able to boot if that happened. If it never falls back on /dev/sdb, there's no point.

Thanks!
 
  


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
grub.cfg file configuration help niravshah Linux - Newbie 4 09-19-2009 09:53 PM
grub configuration file Glemu Linux - Newbie 3 10-19-2006 02:23 AM
GRUB Configuration file Woes. Simdude90015 Linux - Software 12 01-27-2006 08:51 PM
Grub configuration file Buruma Linux - Newbie 10 06-20-2005 09:29 PM
Not reading kickstart configuration file from specified location.....PLEASE HELP!! deepika Linux - Software 4 08-02-2003 08:00 PM

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

All times are GMT -5. The time now is 07:36 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