| View previous topic :: View next topic |
| Author |
Message |
MALDATA n00b

Joined: 07 Apr 2011 Posts: 15
|
Posted: Fri Jan 20, 2012 1:26 am Post subject: Kernel lines in grub.conf don't appear in grub |
|
|
I have an odd problem. I was running kernel 3.0.6 and got the 3.1.6 update to gentoo-sources through portage. I compiled and installed 3.1.6 as usual, and added the kernel lines to the top of grub.conf, so 3.1.6 should have become the default on the next reboot.
I then pretty much just forgot about it, because I assumed on my next reboot it'd boot 3.1.6 as expected. That was about a week ago, and I just noticed now that for some reason it's still booting 3.0.6. I actually paid attention the next time I booted, and 3.1.6 is not even an option on the grub boot menu. It almost seems like grub isn't using grub.conf at all.
I also tried booting 3.1.6 by manually editing the kernel line in grub, changing 3.0.6 to 3.1.6, and it said it couldn't find the file... for your reference, here's my /boot directory and my grub.conf. Any ideas?
| Code: |
$ ls /boot
System.map-2.6.39-gentoo-r3 config-2.6.39-gentoo-r3 lost+found
System.map-2.6.39-gentoo-r3.old config-2.6.39-gentoo-r3.old vmlinuz-2.6.39-gentoo-r3
System.map-3.0.6-gentoo config-3.0.6-gentoo vmlinuz-2.6.39-gentoo-r3.old
System.map-3.1.6-gentoo config-3.1.6-gentoo vmlinuz-3.0.6-gentoo
System.map-3.1.6-gentoo.old config-3.1.6-gentoo.old vmlinuz-3.1.6-gentoo
boot grub vmlinuz-3.1.6-gentoo.old
|
| 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:
|
|
|
| Back to top |
|
 |
Jaglover Advocate


Joined: 29 May 2005 Posts: 3404 Location: Saint Amant, Acadiana
|
Posted: Fri Jan 20, 2012 1:51 am Post subject: |
|
|
Things like that happen when you forget to mount /boot. Try running ls on /boot when mounted and when umounted. If you see anything on umounted /boot ... _________________ Please learn how to denote units correctly! |
|
| Back to top |
|
 |
MALDATA n00b

Joined: 07 Apr 2011 Posts: 15
|
Posted: Fri Jan 20, 2012 2:32 am Post subject: |
|
|
Thanks, Jaglover, but that didn't seem to be the problem here. I always have /boot mounted. I gave it a try anyway though... after unmounting /boot, I went in there and there weren't any files.
Other ideas? |
|
| Back to top |
|
 |
dwbowyer Tux's lil' helper

Joined: 18 Apr 2008 Posts: 139
|
Posted: Fri Jan 20, 2012 2:42 am Post subject: |
|
|
could we see
edit and
I'm thinking you may have copied a 3.0.6 built kernel to /boot with 3.1.6 name,. but uname -r should ought still report the internal version. |
|
| Back to top |
|
 |
MALDATA n00b

Joined: 07 Apr 2011 Posts: 15
|
Posted: Fri Jan 20, 2012 3:06 am Post subject: |
|
|
Sure thing.
| 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
|
| Code: |
$ ls -l /usr/src
total 78996
lrwxrwxrwx 1 root root 18 Jan 8 22:24 linux -> linux-3.1.6-gentoo
drwxr-xr-x 20 root root 4096 Dec 12 20:23 linux-2.6.39-gentoo-r3
drwxrwxr-x 23 root root 4096 Aug 29 15:56 linux-3.0.4
-rw-r--r-- 1 root root 76759291 Sep 18 22:14 linux-3.0.4.tar.bz2
drwxr-xr-x 24 root root 4096 Dec 13 19:02 linux-3.0.6-gentoo
drwxr-xr-x 24 root root 4096 Jan 19 19:04 linux-3.1.6-gentoo
drwxr-xr-x 6 root root 4096 Sep 1 2010 v4l-dvb-a4c762698bcb
-rw-r--r-- 1 root root 4019180 Sep 1 2010 v4l-dvb-a4c762698bcb.tar.bz2
lrwxrwxrwx 1 root root 28 Oct 3 22:50 vboxhost-4.1.4 -> /opt/VirtualBox/src/vboxhost
|
And just for good measure,
| Code: |
$ uname -r
3.0.6-gentoo
|
|
|
| Back to top |
|
 |
dwbowyer Tux's lil' helper

Joined: 18 Apr 2008 Posts: 139
|
Posted: Fri Jan 20, 2012 4:25 am Post subject: |
|
|
To test on my system I did added the following on my system
| Code: |
title JustATest
root (hd0,0)
kernel /boot/4.0.9-gentoo root=/dev/sda3 vga=0x318
|
With no such kernel file on the partition, the menu entry still shows up in the grub menu. Attempting to boot from it produces
| Code: |
Error 15: File Not Found
|
Which is what I'd expect. The fact that you do NOT see the menu entry suggests that something is wrong in the /boot/grub/grub.conf
itself, possibly to do with whitespace characters. I suggest deleting those lines, and the preceding and following EOL (end-of-line) characters.
Just to be clear, I mean everything between the red asterisks, below. Then re-create those lines and save the grub.conf. Reboot and see if the
entry shows up.
| Quote: |
#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
|
| MALDATA wrote: |
I also tried booting 3.1.6 by manually editing the kernel line in grub, changing 3.0.6 to 3.1.6, and it said it couldn't find the file...
|
That itself should have worked. But whether 1: the file exists, 2: is a valid uncorrupted kernel file
are possibly separate issues from 3: shows up as a grub menu entry. One thing at a time. |
|
| Back to top |
|
 |
MALDATA n00b

Joined: 07 Apr 2011 Posts: 15
|
Posted: Fri Jan 20, 2012 4:35 am Post subject: |
|
|
Removed and rewrote those lines in my grub.conf... no difference at all.
I'm completely baffled... |
|
| Back to top |
|
 |
dwbowyer Tux's lil' helper

Joined: 18 Apr 2008 Posts: 139
|
Posted: Fri Jan 20, 2012 4:44 am Post subject: |
|
|
You could use my JustATest example above just to verify that it shows up in the grub menu. That rules out any oddity about grub.conf.
EDIT just change the root (hd0, 1) or that will be it's own problem, |
|
| Back to top |
|
 |
cld71 Tux's lil' helper

Joined: 12 Jul 2005 Posts: 86
|
Posted: Fri Jan 20, 2012 4:47 am Post subject: |
|
|
| MALDATA wrote: | Removed and rewrote those lines in my grub.conf... no difference at all.
I'm completely baffled... |
This is a long shot, but have you checked that your "/boot/grub/menu.lst" file is a link to your grub.conf like this "menu.lst -> grub.conf" when doing an "ls -la" on /boot/grub directory? |
|
| Back to top |
|
 |
MALDATA n00b

Joined: 07 Apr 2011 Posts: 15
|
Posted: Fri Jan 20, 2012 3:20 pm Post subject: |
|
|
dwbowyer: I'll give it a shot when I get home and let you know.
cld71: Yeah, I checked that. The link is there and it's valid.
Thanks, and keep the suggestions coming. |
|
| Back to top |
|
 |
Jaglover Advocate


Joined: 29 May 2005 Posts: 3404 Location: Saint Amant, Acadiana
|
|
| Back to top |
|
 |
eccerr0r Advocate

Joined: 01 Jul 2004 Posts: 2354 Location: USA
|
Posted: Fri Jan 20, 2012 6:04 pm Post subject: |
|
|
Not 100% sure if this is the same issue but one thing I ran into with grub is installing grub on the wrong partition so the grub.conf it's looking for is never in the right place.
You want to install grub on the MBR and have it point to stage1,stage2, etc. on the right partition.
I'd suggest people not use a /boot parition when first trying installing grub unless absolutely needed - usually only if your BIOS can't access your whole disk. In any case I've found that grub-install does automagically do the right thing as long as the correct disks are mounted in the right place.
If you grub-install to your /boot partition directly (like /dev/sda2), then it will think things should be rooted in that disk. Your menu.lst (which is the proper grub config file - a symlink makes it grub.conf) would expect to be in that disk's boot/grub directory. Sounds right? No, after you mount that partition to /boot, the config file is /boot/boot/grub/menu.lst instead... ouch.
I still have a lot of disks that have screwed up partitions and don't want to touch them since they're working... once they break I'll fix them after finding the correct solution... _________________ Core2Quad 9550S/4GB/4x500G RAID5/RadeonHD 5770
What the heck am I advocating? |
|
| Back to top |
|
 |
Logicien Guru


Joined: 16 Sep 2005 Posts: 337 Location: Montréal
|
Posted: Fri Jan 20, 2012 7:34 pm Post subject: |
|
|
Hi,
in Grub version one, the grub-install command copy things in /boot/grub and than install the boot loader where it have been specified. If you only write
| Code: | | grub-install /dev/sda |
Grub will assume the root for it is the root partition of Gentoo, so here /dev/sda3. In reality Grub root shoud be /dev/sda2, because you have a /boot/partition. If this partition is always mounted, everythings should be in. So using the Grub shell I would do
| Code: | | grub> setup (hd0) (hd0,1) |
to tell Grub to install to the MBR and use /dev/sda2 as the partition for it to find it's files. That procedure probably could be done with the grub-install command to. The /boot directory should be empty or with only a .keep file before the boot partition is mounted in by Gentoo. _________________ Paul |
|
| Back to top |
|
 |
MALDATA n00b

Joined: 07 Apr 2011 Posts: 15
|
Posted: Sat Jan 21, 2012 2:48 am Post subject: |
|
|
| I'm not sure I understand. Everything's been working fine with this installation for a couple years now. Why would any of this start causing a problem now? |
|
| Back to top |
|
 |
Jaglover Advocate


Joined: 29 May 2005 Posts: 3404 Location: Saint Amant, Acadiana
|
Posted: Sat Jan 21, 2012 2:57 am Post subject: |
|
|
I'm not sure I understand your response, did you try re-running grub-install or not? Doing so cannot harm your Gentoo but it may resolve your problem. _________________ Please learn how to denote units correctly! |
|
| Back to top |
|
 |
Logicien Guru


Joined: 16 Sep 2005 Posts: 337 Location: Montréal
|
Posted: Sat Jan 21, 2012 3:27 am Post subject: |
|
|
So, your installation of Grub one date from years now. Grub one have probably been updated since then. Reinstall Grub in the MBR with
| Code: | | grub-install /dev/sda |
will copy again the files from /usr/lib/grub/*/* to /boot/grub and install it's bootloader in the MBR. With that, you will be sure all the files it use are up to date. In plus I would reinstall again the Grub bootloader with the Grub shell commands
| Code: | grub
...
grub> setup (hd0) (hd0,1)
grub> exit |
Everythings will be clear an up to date. If the problem persist, we will know it is not coming from Grub installation.
You have a boot symlink to /boot in the /boot directory. Me with ArchLinux, I use only /boot/grub/menu.lst as the configfile for Grub one. You have'nt show the contain of /boot/grub. A symlink from grub.conf to menu.lst in that directory can be usefull. Better can be to copy grub.conf to menu.lst. I ever read that Grub do not like symlink. Your grub.conf look good. There is a command call grub-set-default you can use to set the default boot entry in Grub one. Something have to be done to resolv this problem.
I use mainly Grub two now. |
|
| Back to top |
|
 |
derk Apprentice

Joined: 10 Mar 2003 Posts: 245 Location: St Thomas Ontario
|
Posted: Sat Jan 21, 2012 3:19 pm Post subject: |
|
|
um If you have two root partitions .. i.e. sda1 and sda2 and kernels installed on both corresponding boot directories (works with a separate boot as well)
this works:
title sam0 Gentoo Linux 3.2.1
root (hd0,0)
kernel (hd0,0)/boot/vmlinuz-3.2.1-gentoo root=/dev/sda1
title sam1 Gentoo Linux 3.2.1
root (hd0,1)
kernel (hd0,1)/boot/vmlinuz-3.2.1-gentoo root=/dev/sda2 |
|
| Back to top |
|
 |
dwbowyer Tux's lil' helper

Joined: 18 Apr 2008 Posts: 139
|
Posted: Sun Jan 22, 2012 1:52 am Post subject: |
|
|
| Not sure it's worth mentioning but I just read in 3.0.6 menuconfig while doing something else that the ramdisk_size option is obsolete. Perhaps try removing the opt? |
|
| Back to top |
|
 |
MALDATA n00b

Joined: 07 Apr 2011 Posts: 15
|
Posted: Mon Jan 23, 2012 4:50 am Post subject: |
|
|
Jaglover:
| Quote: | | did you try re-running grub-install or not? |
Yep, still the same issue.
Logicien:
| Quote: | | You have'nt show the contain of /boot/grub |
Here it is:
| Code: |
$ ls -al /boot/grub/
total 448
drwxr-xr-x 2 root root 1024 Jan 20 20:48 .
drwxr-xr-x 4 root root 1024 Jan 19 19:04 ..
-rw-r--r-- 1 root root 197 Jun 25 2009 default
-rw-r--r-- 1 root root 60 Jun 25 2009 device.map
-rw-r--r-- 1 root root 8756 Aug 1 2010 e2fs_stage1_5
-rw-r--r-- 1 root root 7836 Aug 1 2010 fat_stage1_5
-rw-r--r-- 1 root root 7112 Aug 1 2010 ffs_stage1_5
-rw-r--r-- 1 root root 1050 Jan 20 20:48 grub.conf
-rw-r--r-- 1 root root 1050 Jan 19 22:32 grub.conf~
-rw-r--r-- 1 root root 7104 Aug 1 2010 iso9660_stage1_5
-rw-r--r-- 1 root root 8692 Aug 1 2010 jfs_stage1_5
lrwxrwxrwx 1 root root 9 Jun 25 2009 menu.lst -> grub.conf
-rw-r--r-- 1 root root 7328 Aug 1 2010 minix_stage1_5
-rw-r--r-- 1 root root 9732 Aug 1 2010 reiserfs_stage1_5
-rw-r--r-- 1 root root 33856 Aug 1 2010 splash.xpm.gz
-rw-r--r-- 1 root root 512 Aug 1 2010 stage1
-rw-r--r-- 1 root root 107988 Aug 1 2010 stage2
-rw-r--r-- 1 root root 107892 Jun 25 2009 stage2.old
-rw-r--r-- 1 root root 107988 Aug 1 2010 stage2_eltorito
-rw-r--r-- 1 root root 7368 Aug 1 2010 ufs2_stage1_5
-rw-r--r-- 1 root root 6712 Aug 1 2010 vstafs_stage1_5
-rw-r--r-- 1 root root 9532 Aug 1 2010 xfs_stage1_5
|
dwbowyer:
| Quote: | | Not sure it's worth mentioning but I just read in 3.0.6 menuconfig while doing something else that the ramdisk_size option is obsolete. Perhaps try removing the opt? |
Tried it, still no luck.
Thanks again for the help, everyone. Tried a few other things too, but nothing's working. Where to from here? |
|
| Back to top |
|
 |
Logicien Guru


Joined: 16 Sep 2005 Posts: 337 Location: Montréal
|
Posted: Mon Jan 23, 2012 6:44 am Post subject: |
|
|
Did you execute the Grub shell commands
| Code: | grub
...
grub> setup (hd0) (hd0,1)
...
grub> exit |
_________________ Paul |
|
| Back to top |
|
 |
MALDATA n00b

Joined: 07 Apr 2011 Posts: 15
|
Posted: Mon Jan 23, 2012 3:16 pm Post subject: |
|
|
Logicien
| Quote: | | Did you execute the Grub shell commands |
Yes I did. |
|
| Back to top |
|
 |
Knute Guru


Joined: 28 Jun 2004 Posts: 305 Location: Fargo, ND
|
Posted: Mon Jan 23, 2012 8:00 pm Post subject: |
|
|
Just a quick question.... Are you using grub or grub-static???
grub is actually grub2, and an update may have auto-migrated you over to grub2.
If you have a /boot/grub2 directory, then odds are you are using grub2, where the grub1 config files don't work.
If you have that directory try running the command: grub2-mkconfig -o /boot/grub2/grub.cfg as root.
This command will update your configs so that it should show up. (I have simply made it a script file with executable file permission and root ownership in /sbin)
HTH _________________ Knute
----------
The human race has one really effective weapon, and that is laughter.
-- Mark Twain
If you want proof of that, take a look at windows sometime.  |
|
| Back to top |
|
 |
Knute Guru


Joined: 28 Jun 2004 Posts: 305 Location: Fargo, ND
|
Posted: Mon Jan 23, 2012 8:01 pm Post subject: |
|
|
Just a quick question.... Are you using grub or grub-static???
grub is actually grub2, and an update may have auto-migrated you over to grub2.
If you have a /boot/grub2 directory, then odds are you are using grub2, where the grub1 config files don't work.
If you have that directory try running the command: grub2-mkconfig -o /boot/grub2/grub.cfg as root.
This command will update your configs so that it should show up. (I have simply made it a script file with executable file permission and root ownership in /sbin)
HTH _________________ Knute
----------
The human race has one really effective weapon, and that is laughter.
-- Mark Twain
If you want proof of that, take a look at windows sometime.  |
|
| Back to top |
|
 |
MALDATA n00b

Joined: 07 Apr 2011 Posts: 15
|
Posted: Tue Jan 24, 2012 3:22 am Post subject: |
|
|
I'm using grub
| Code: |
* sys-boot/grub
Latest version available: 0.97-r10
Latest version installed: 0.97-r10
Size of files: 1,036 kB
Homepage: http://www.gnu.org/software/grub/
Description: GNU GRUB Legacy boot loader
License: GPL-2
* sys-boot/grub-static
Latest version available: 0.97-r10
Latest version installed: [ Not Installed ]
Size of files: 868 kB
Homepage: http://www.gnu.org/software/grub/
Description: GNU GRUB Legacy boot loader (static build)
License: GPL-2
|
But it doesn't appear to be grub2. I do not have a /boot/grub2 directory. |
|
| Back to top |
|
 |
Logicien Guru


Joined: 16 Sep 2005 Posts: 337 Location: Montréal
|
Posted: Tue Jan 24, 2012 5:47 am Post subject: |
|
|
Have you try to umount the boot partition (umount /boot) and see what is the contain of the /boot directory (ls -a /boot) when nothing is mounted in? You use, if I understand, RAID (/dev/md3). That can change the way Grub see the partitions table. I never had to use LVM and RAID. I cannot help for that. I have to study first.
I think it not to early to switch to Grub two even if it is unstable and masked according to Portage. I use it since a while with others Linux distributions. It work fine when you understand the version. Grub one stay easier but, with less features. |
|
| Back to top |
|
 |
|