[SOLVED] Grub is not reading its configuration file
Linux - SoftwareThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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:
$ 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
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.