# Need help upgrading my kernel

## gcrew

It's been a while since I've updated my kernel, and now that I'm trying to update it I'm having troubles.

When I reboot, it just loads my old kernel.

I prefer to install my kernel the old fashioned and have had no problem doing it this way in the past by manually configuring it and installing it.

Since that didn't work immediately, I decided to try and give genkernel a try.  That didn't help either.

Here's the command I used for genkernel:

```
genkernel --install --no-splash --menuconfig all
```

I actually tried to use the default config first before switching to menuconfig when it didn't work.

Here is my old kernel

```
# cat /proc/version 

Linux version 2.6.28-gentoo-r5 (root@mybox) (gcc version 4.3.2 (Gentoo 4.3.2-r3 p1.6, pie-10.1.5) ) #1 Mon May 11 01:24:59 EDT 2009
```

I still have the sources for my old kernel, but I'm unable to compile them anymore.

Perhaps of interest is my newer gcc

```
# gcc-config -l

 [1] x86_64-pc-linux-gnu-4.4.4 *
```

Here is my /boot/grub/grub.conf:

```
# 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,0)

#          kernel /vmlinuz-version ro root=/dev/sda6

#          initrd /initrd-version.img

#boot=/dev/sda

default=1

fallback=0

timeout=5

#splashimage=(hd0,0)/grub/splash.xpm.gz

hiddenmenu

title Gentoo (2.6.28-r5)

        root (hd1,0)

        kernel /kernel-2.6.28-gentoo-r5 ro root=/dev/sda9

title=Gentoo Linux (2.6.36-gentoo-r5)

        root (hd1,0)

        kernel /kernel-genkernel-x86_64-2.6.36-gentoo-r5 ro root=/dev/sda9 real_root=/dev/sda9

        initrd /initramfs-genkernel-x86_64-2.6.36-gentoo-r5

```

I think I'd rather not use an initrd, but if it helps me update my kernel then I can live with it.

A few things of note about my system.  I built it myself about six years ago, and by now I forgot most of the details of what I put in there.  I do know that it's an AMD64 with a SATA hard drive, a dirt old CD drive and a dirt old IDE hard drive I salvaged from my college computer.  I do not own a graphics card.  I borrowed one when setting up the system, but no longer have one.  Unfortunately, this means I can't tell you if there are any errors on screen during a reboot.

I'd be glad to post any additional configuration information if needed.

----------

## jburns

```
kernel /kernel-genkernel-x86_64-2.6.36-gentoo-r5 ro root=/dev/sda9 real_root=/dev/sda9 
```

 should be 

```
kernel /kernel-genkernel-x86_64-2.6.36-gentoo-r5 ro root=/dev/ram0 real_root=/dev/sda9 
```

----------

## gcrew

I fixed that and rebooted but no change.

Any idea what the most likely problem is?  Is my grub configuration wrong?  Am I missing some vital kernel option?

It occurred to me that this may be interesting too:

```
# lspci -k

00:00.0 Host bridge: nVidia Corporation nForce3 250Gb Host Bridge (rev a1)

        Kernel driver in use: agpgart-amd64

00:01.0 ISA bridge: nVidia Corporation nForce3 250Gb LPC Bridge (rev a2)

        Subsystem: Giga-byte Technology Device 0c11

00:01.1 SMBus: nVidia Corporation nForce 250Gb PCI System Management (rev a1)

        Subsystem: Giga-byte Technology Device 0c11

        Kernel driver in use: nForce2_smbus

00:02.0 USB Controller: nVidia Corporation CK8S USB Controller (rev a1)

        Subsystem: Giga-byte Technology Device 5004

        Kernel driver in use: ohci_hcd

00:02.1 USB Controller: nVidia Corporation CK8S USB Controller (rev a1)

        Subsystem: Giga-byte Technology Device 5004

        Kernel driver in use: ohci_hcd

00:02.2 USB Controller: nVidia Corporation nForce3 EHCI USB 2.0 Controller (rev a2)

        Subsystem: Giga-byte Technology Device 5004

        Kernel driver in use: ehci_hcd

00:06.0 Multimedia audio controller: nVidia Corporation nForce3 250Gb AC'97 Audio Controller (rev a1)

        Subsystem: Giga-byte Technology Device a002

00:08.0 IDE interface: nVidia Corporation CK8S Parallel ATA Controller (v2.5) (rev a2)

        Subsystem: Giga-byte Technology Device 5002

00:0a.0 IDE interface: nVidia Corporation nForce3 Serial ATA Controller (rev a2)

        Subsystem: Giga-byte Technology Device b002

        Kernel driver in use: sata_nv

00:0b.0 PCI bridge: nVidia Corporation nForce3 250Gb AGP Host to PCI Bridge (rev a2)

00:0e.0 PCI bridge: nVidia Corporation nForce3 250Gb PCI-to-PCI Bridge (rev a2)

00:18.0 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] HyperTransport Technology Configuration

00:18.1 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Address Map

00:18.2 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] DRAM Controller

00:18.3 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Miscellaneous Control

02:08.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ (rev 10)

        Subsystem: Belkin F5D5000 PCI Card/Desktop Network PCI Card

        Kernel driver in use: 8139too

02:0a.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ (rev 10)

        Subsystem: Belkin F5D5000 PCI Card/Desktop Network PCI Card

        Kernel driver in use: 8139too

02:0b.0 Ethernet controller: Marvell Technology Group Ltd. 88E8001 Gigabit Ethernet Controller (rev 13)

        Subsystem: Giga-byte Technology Marvell 88E8001 Gigabit Ethernet Controller (Gigabyte)

        Kernel driver in use: skge

```

----------

## Goverp

 *gcrew wrote:*   

> It's been a while since I've updated my kernel, and now that I'm trying to update it I'm having troubles.
> 
> When I reboot, it just loads my old kernel.
> 
> I prefer to install my kernel the old fashioned and have had no problem doing it this way in the past by manually configuring it and installing it.
> ...

 

I'm not surprised genkernel didn't work; what you're seeing is nothing to do with HOW you make your kernel,  It's a problem with what you did with it...

grub looks for a file with a specific name in a specific disk partition.  To upgrade your kernel, you must either create a new file in the same partition with the same name, or change grub.conf to look for the different file name.  Typically the kernel file name contains the kernel version - I'm currently using "vmlinuz-2.6.36-gentoo-r5".  So if you upgrade your kernel to a new version, you need to change the file name in grub.conf.

If you use the ext2/3/4 file systems, you can use a symbolic link "vmlinuz" to the kernel file.  Issuing "make install" after "make && make modules_install" will maintain that link pointing at your most recent kernel (and also "vmlinuz.old" pointing at the previous, which is rather useful if you foul up making the new kernel!).  I have two entries, one for "vmlinuz" and one for "vmlinuz.old" in my grub.conf.

Another boobytrap: if you built your system with a separate /boot partition, it's oh-so-easy to forget to mount it before copying the kernel over, in which case your shiny new kernel is sitting in the /boot directory on your rootfs partition, and not in the partition that grub is looking at!

----------

## chiefbag

1: Firstly make sure your symlink is pointing to the new kernel source

2: I would suggest moving the new kernel version to the top of your grub.conf as you only have a 5 second timeout configured.

 *Quote:*   

> 
> 
> Another boobytrap: if you built your system with a separate /boot partition, it's oh-so-easy to forget to mount it before copying the kernel over, in which case your shiny new kernel is sitting in the /boot directory on your rootfs partition, and not in the partition that grub is looking at!

 

genkernel will mount the boot partition automatically and copy the image to there after compilation.

----------

## gcrew

I do have a separate /boot partition, but I'm pretty sure genkernel put the kernel in the correct place.  One more piece of information about my system is that I originally built it as a dual boot with Redhat, but I dumped Redhat after a few days to use Gentoo full time.  They shared the /boot and /home partitions.  Some of my files in /boot are from the Redhat install, and aren't necessary anymore but I'm too chicken to delete them.

```
boot # ls

System.map-2.6.36-gentoo-r5                   boot.0340                config-2.6.36-gentoo-r5  initramfs-genkernel-x86_64-2.6.36-gentoo-r5  kernel-genkernel-x86_64-2.6.36-gentoo-r5

System.map-genkernel-x86_64-2.6.36-gentoo-r5  boot.0800                grub                     kernel-2.6.28-gentoo-r5                      lost+found

boot                                          config-2.6.28-gentoo-r5  grub.conf                kernel-2.6.36-gentoo-r5

boot # ls grub

default     e2fs_stage1_5  ffs_stage1_5  grub.conf.bak     jfs_stage1_5  minix_stage1_5     splash.xpm.gz  stage2      stage2_eltorito  vstafs_stage1_5

device.map  fat_stage1_5   grub.conf     iso9660_stage1_5  menu.lst      reiserfs_stage1_5  stage1         stage2.old  ufs2_stage1_5    xfs_stage1_5

boot # cd /

/ # umount boot 

/ # ls boot/

boot  grub

/ # ls boot/grub/

device.map

```

By symlink, I assume you mean the one in /usr/src?  I think I got that right:

```
boot # eselect kernel list

Available kernel symlink targets:

  [1]   linux-2.6.28-gentoo-r5

  [2]   linux-2.6.36-gentoo-r5 *

boot # ls -l /usr/src/

total 8

lrwxrwxrwx  1 root root   22 Feb  1 13:39 linux -> linux-2.6.36-gentoo-r5

drwxr-xr-x 23 root root 4096 Jan  6 21:21 linux-2.6.28-gentoo-r5

drwxr-xr-x 24 root root 4096 Feb  2 14:35 linux-2.6.36-gentoo-r5

```

I don't think I understand why you suggest moving the new kernel higher.  In the past, I was able to rescue a messed up kernel a couple times by hitting escape up up up up, escape up up up up, etc. after a reboot.  If my known working kernel wasn't the top one, I'm afraid I might not be able to pick the backup kernel.  I'd also prefer to not mess with the fallback position since I know that works right now.

Thanks for the tips, but I'm afraid I'm still stuck.

----------

## chiefbag

Ok my first reason for suggesting moving your most recent kernel version to the top of the grub.conf is cos after the 5 second timeout you have set it will boot the first kernel in the list, my personal preference would be ensure this is the latest kernel you have built. 

Your symlink to the new kernel looks ok to me so I would not worry about that. 

What I would recommend you do is boot in again with a livecd and mk2fs on your boot partition to remove any conflicts that my linger as a result of your previous dual boot. 

Then Chroot and zcat your config from the livecd. 

Rebuild the kernel using genkernel and be sure to edit your fstab and copy the mtab file also. 

Finally install grub and edit your grub.conf file accordingly. 

Also rebuild udev and Hal against the new kernel. 

After that you should be good to go. 

If in doubt refer to kernel upgrade and installing the boot loader in the gentoo docs.

----------

## Trog Dog

If you remove fallback=0 from your grub menu what happens?

----------

## jburns

Post the .config for the kernel.  There could be a configuration problem.  If you used the default configuration with genkernel try adding doscsi at the end of the kernel line.

----------

## gcrew

I tried adding doscsi to the kernel line.  My grub.conf now looks like this:

```
default=1

fallback=0

timeout=5

#splashimage=(hd0,0)/grub/splash.xpm.gz

hiddenmenu

title Gentoo (2.6.28-r5)

        root (hd1,0)

        kernel /kernel-2.6.28-gentoo-r5 ro root=/dev/sda9

title=Gentoo Linux (2.6.36-gentoo-r5)

        root (hd1,0)

        kernel /kernel-genkernel-x86_64-2.6.36-gentoo-r5 ro root=/dev/ram0 real_root=/dev/sda9 doscsi

        initrd /initramfs-genkernel-x86_64-2.6.36-gentoo-r5

```

I'm sorry I haven't tried everything else, but I'm extremely afraid of losing my computer.  If I change something and it won't boot, I'm toast.

I've upgraded the kernel many times in the past.  The system has been up and running for about 6 years now and I switched over to Gentoo full time after only about a month.  I really don't think there's anything wrong with my grub install or the boot directory.

I've reloaded udev a couple times.  One thing I notice is that it complains that CONFIG_IDE is set.  I'm pretty sure I didn't set it myself.

Here is my config from genkernel.  Do you want me to post my working 2.6.28 config too?

Edit: Removed copy and pasted config in lieu of links below.Last edited by gcrew on Thu Feb 10, 2011 10:33 pm; edited 1 time in total

----------

## gcrew

Whoops, I assume that's too big.

I put my configs here:

http://claquesous.homelinux.org/config.new

http://claquesous.homelinux.org/config.working

----------

## jburns

You have CONFIG_IDE set which causes the kernel to use /dev/hd... instead of /dev/sd... device names.  Udev has dropped support of /dev/hd....  Since the IDE drivers where built into the kernel adding doscsi had no effect.  You should build the SATA and PATA that you need in the kernel.

CONFIG_IDE should not be set but keep CONFIG_HAVE_IDE=y.

----------

## gcrew

I changed that, but still no change.

I updated the previous link with the new new config.

----------

## jburns

Try setting CONFIG_PATA_AMD, that will enable the driver for the IDE ports.

----------

## jimfaster

Hello everyone, after installing (and upgrading) the kernel Liquorix I now have a menu (GNU GRUB version 1.9 :Cool:  with the ability to select the kernel I want to use during startup (there are six possibilities : liquorix x2 + + Generic Safe mode for all).

----------

## gcrew

I tried setting CONFIG_PATA_AMD.  I also recompiled udev since I forgot to do that after turning off IDE.  It now compiles without complaining.

Unfortunately, it still booted up with the old kernel.

Somewhere I read something about grub remembering the default kernel.  Is there any possibility it isn't even trying to load my new kernel since something with the same name didn't work once?

----------

## Goverp

Grub remembers very little - it has to be simple, as the early grub phases have to be physically quite small.

I note you have two grub.confs, one in  /boot, and one in /boot/grub.  AFAIK grub only uses the second one.  Editing the first will have no effect.  My guess is that this is your problem.

IIUC, you are using the separate boot partition.

If so, you can safely remove the contents of the boot directory on your / partition (a boot directory link and a grub directory containing device.map); they just confuse things.  Make sure to leave the empty boot directory as a mount point, though.

You said you have no graphics card.  Does that mean you have no screen at all, or do you have an integrated graphics device (e.g. my AMD 64 motherboard has a built-in ATI graphics device)?  If no screen, I appreciate your difficulty - though in that case if problems persist it would be worth borrowing some kit.  If you do have some level of screen display, you can safely, and usefully, remove (or comment out) the hiddenmenu command, and change the timeout command to say 60, to give yourself time to see what's happening.  You can then type "e" to edit the boot commands (this is only the ones being executed in memory, it has NO EFFECT on the grub.conf file) and see if they really point at your new kernel or not.  If OK, then type "b" to boot.  If wrong, type "e" again to get the grub command line editor, where you can backspace and hit <tab> to use auto-completion to see what's in the directory/partition that grub is using.

If you're scared that fooling around with grub will render your box unbootable, and thereby cut you off from the internet, it's worth getting hold of something like a Knoppix CD or other bootable system disk you can fall back to for internet use.

----------

