# booting an "upgraded" kernel (or not, in this case

## bigjohn

A recently installed system, problems getting updates, that I managed to sort here at the GDF's (different forum though).

One of the updates was kernel version 2.6.11-gentoo-r8. Previously, I've just followed the instruction in the kernel upgrade guide.

This time, I've followed the instructions, but when I try to boot the kernel I just get this

 *Quote:*   

> 
> 
> >>Block device /dev/hda3 is not a valid root device...
> 
> >>The root block device is unspecified or not detected.
> ...

 

As a last ditch effort, just in case it was a grub issue, I've unmerged grub and emerged lilo and get the same result.

Could someone advise me on how I correct this please?

regards

John

----------

## NeddySeagoon

bigjohn,

It looks like you have left either the chipset driver or filesystem driver out of the kernel. However, you mentioned updates, have you upgraded from devfs to udev but missed coldplug and hotplug and removing devfs along the way (or some combination) ?

I could read into your error that /dev/hda3 doesn't exist. 

Tell us more about the nature of the updates.

----------

## ArsDangor

If your harddisk is a SATA one, your root will be /dev/sda3, instead of /dev/hda3.

----------

## bigjohn

 *NeddySeagoon wrote:*   

> bigjohn,
> 
> It looks like you have left either the chipset driver or filesystem driver out of the kernel. However, you mentioned updates, have you upgraded from devfs to udev but missed coldplug and hotplug and removing devfs along the way (or some combination) ?
> 
> I could read into your error that /dev/hda3 doesn't exist. 
> ...

 

The updates where just what "arrived" once I'd finished installing from the disc(s) (stage 3 + GRP to get the system up and running quickly). I did the usual 

```
emerge -uD world
```

 and apart from the fact that there was a mountain of updates, one of them happened to be 2.6.11-gentoo-r8, so I just did as I've done previously and compiled it using genkernel as it says in the kernel upgrade guide. I'm stuck with that, because I haven't managed to learn enough about what I'd need to "have" if I tried to compile it manually (i.e. I don't know which to select from the absolute plethora of choices - sure, some I can guess, like I know that my network card is one with a national semiconductors chipset, and I've found the module selection for that, but most of it is an absolute mystery).

As for hot and cold plug, no they were emerged during the initial install, and the system has used udev from install (not that I know the difference between udev and devfs, other than devfs is deprecated).

The bootloader (initally grub, but now lilo) has both versions listed, with identical entries, apart from the kernel and initrd names. The -r3 will boot, the -r8 won't

 *Quote:*   

> 
> 
> boot=/dev/hda
> 
> prompt
> ...

 

Oh and no it's just and normal non-SATA hard disc.

regards

John

----------

## NeddySeagoon

bigjohn,

Since you have one kernel that works and one that doesn't its an ideal time to learn to 'roll your own', if you want to invest an hour or two. After 2 or 3 goes, it will only be 10 minutes.

If you have X on that box its even easier.

cd /usr/src/linux  (make sure thats your -r8 kernel)

make xconfig      (a nice gui kernel config tool)

Look but don't change anything. You will be starting from the mess that genkernel leaves if you do.

You don't want to do that.

Post back if you want to go down this route.

----------

## bigjohn

 *NeddySeagoon wrote:*   

> bigjohn,
> 
> Since you have one kernel that works and one that doesn't its an ideal time to learn to 'roll your own', if you want to invest an hour or two. After 2 or 3 goes, it will only be 10 minutes.
> 
> If you have X on that box its even easier.
> ...

 

Well, apart from the fact that I'm working for the next 3 days, and I'm not sure how to tell whether I'm in the -r8 kernel or not (I presume that I can always just remake the symlink as I would have done for a normal kernel upgrade??? That might do the job??) so times tight, and any replys to posts would be erratic.

But having just had a look at the xconfig, now that looks rather interesting.

regards

John

----------

## bav

Before you try that, you might like to try adding --udev to your genkernel line. I experienced the same problem as you - 

```
Block device /dev/hda6 is not a valid root device... 
```

Turns out I was using my old method of invoking genkernel:

```
genkernel --menuconfig --bootloader=grub all
```

I used this instead:

```
genkernel --udev --menuconfig --bootloader=grub --clean --install all
```

And normal service has resumed....

----------

## bigjohn

that's exactly what I did bav.

did you suss out the new way of doing that, or do you have a link to some new instructions for getting genkernel to "get it right"?

Because I've obviously got something wrong here, and for the life of me, can't work out why, though as both bootloaders are having the same problem it's got to be a problem with either genkernel or the kernel itself (as all indications show that it's not a hardware problem).

regards

John

----------

## bigjohn

Well, by using the suggestion, I've invoked genkernel as per what bav said (the sym link for /usr/src/linux was already pointing at the 2.6.8-gentoo-r8 so I didn't need to change that), and then I've unmerged lilo and emerged grub and the nvidia driver and it's now booting into the 2.6.8-gentoo-r8

excellent.

the only odd thing, is that grub is still not very nice too look at, i.e. the grub login screen is virtually unreadable, so I'll have to check to see whats going on there i.e. how to "pass it a correct video mode".

but I'm a lot happier now than I have been for a week or so  :Very Happy:   :Very Happy:   :Very Happy: 

Plus, I'd still like to understand about what NeddySeagoon said about compiling my own kernel - thats something that I SHOULD learn about for future reference.

regards

John

----------

## NeddySeagoon

bigjohn,

When you have X running, you can use one of the GUI tools to configure a kernel. For now, just look.

Open a xterm, cd /usr/src/linux then run ome of, make xconfig or make gconfig. Which one will (or maybe both) work for you depends on the widget sets you have installed.

Have a look at what genkernel has done for you. The advantage of the GUI is the you have the menu, the options and the help on screen at the same time. 

When you want to have a go for real, get a fresh kernel tree, totally unmolested by genkernel and a large (very large) pot of coffee.

Work your way through all the options one at a time, reading the help as you go. It will take an hour or to the first time, even then it won't boot, about 30 min, the second time, because you build on what you already have, then about 10 min. 

The manual config, and build is faster than letting genkerenl build everything known to Linus.

----------

## bigjohn

Oh, Ok Neddy, a quick question though, I found some stuff about xconfig and the images didn't look anything like the ones I managed to get on screen.

So, how would I identify that I had the correct kernel version to "make"?

Also, if I'm just working my way through the kernel upgrade guide, obviously I'd be using the "manual compilation" section, so does the "make xconfig" just replace one of the parts of the instructions?

 *Quote:*   

> 
> 
> Code Listing 5.3: Invoking menuconfig
> 
> # cd /usr/src/linux
> ...

 

Because I'm presuming that "make xconfig" replaces the "make menuconfig" in section 5.3 and then I just carry on and "do" the bits in section 5.4

Which, if thats the case then I'm ready to have a go, as soon as "they" release the next version (or maybe I should emerge the dev-sources ???).

The only thing that's confusing me a little, is that in the example, they are saying use arch/i386/............. now I recently had a bit of a problem with portage, it was something to do with having completed the aforementioned upgrades/updates and if I've got a handle on it, my system is now using the i686 (pentium 4) architecture. So would I have to change the command to reflect that (I'd have already choosen pentium 4 support, instead of generic x86 when doing the "make xconfig" thing???

regards

John.

p.s. Oh and when I do this, is it better to just select options for what I'm doing with the system (and currect hardware) now? Or also select support options for what I might want to have a try at later (and possible new/different hardware)???

----------

## bigjohn

Ha Ha! I've just done my daily emerge -uD world, and what have I found, a nice shiney new kernel version (2.6.11-gentoo-r9).

Which obviously, I've emerged, so at the moment, it's just sitting there and nothing else.

Something to "get my teeth" into?

Further to the question(s) above, is it also a case, that if the option/selection in make xconfig are ones that I've never heard of, that I'm unlikely to need them ??

i.e. I suppose that I'm asking, is there anything that might be "hidden technology" that's likely to trip me up? because while I don't know a huge amount of the technicalities of the hard ware, I know roughly what it is and if it's anything particular (like my network card, which has a national semiconductor chipset and uses the 821*** support - which I happen to have already spotted when I looked at the xconfig gui the other day)???

regards

John

----------

## bigjohn

The previous post has been overtaken by events i.e. I did have a go at xconfig but the bugger wouldn't boot. I'm sure I included everything that I needed to. I also paid special attention to bootloader entries so that it should have looked at the correct kernel image/version, but I obviously screwed up somewhere as it just gave me a black screen that said that it thought it should be looking for an ext2 formatted partition, but only saw an ext3 formatted one.

So I said bollocks to it and used genkernel and did 

```
genkernel --udev --menuconfig --bootloader=grub --clean --install all
```

 but I made sure that the stuff I'll need e.g. lp and paraport support where included so that I'll be able to get my printers going.

And yes, I'm happy to admit to cowardice! kernel compilation is, as far as I'm concerned, "white mans magic". 

Even xconfig came up with a few questions that I didn't know what to do with! Oh well, never mind, I'll just have to look into this again, when the next kernel version is released!

regards

John

----------

## NeddySeagoon

bigjohn,

NeddySeagoons' Rough Guide to DIY Kernels

Have to hand (or accessable) the following :-

lspci output

lsmod output

large pot of strong coffee

clean unconfigured kernel tree

cd to the tree, and run one of the configuration tools, in decreasing order of preference

make xconfig

make gconfig

make menuconfig

make config

Work you way through the list of options, reading the help and drinking the coffee, applying the following rules of thumb:-

1. If you need an option to boot, build it into the kernel. Thats (Y) (*) or a tick depending on your make tool.

2. If you need an option after booting, make it a module. Thes (M) (M) or a dot  depending on your make tool.

3. If you don't need an option, don't make it at all. Thats (N) ( ) or a blank box depending on your make tool.

4. If you don't understand the help, leave the default alone  

We are building a kernel that will not need an initrd file so some examples in ach category are

1. Your root filesystem driver. If root (/) is on an ext3 fs then the kernel needs to be able to read ext3 to load any modules.  Your SATA / SCSI or IDE chipset driver for the chipset controlling the drive where the root filesystem lives. 

2. Things like sound, networking, usb and filesystem types you don't use often

3. ISA bus (if you don't have ISA) The old IDE disk driver, Non IDE CD-ROMS attached to sound cards etcGood use of the 'No' option can save you a lot of reading, because some Y/N dont actually do anything except show/hide other options. You can save and come back to it where you left off. there is no need to do it in one sitting.

Save your configuration, then build and install the kernel with the following seperate commands

make

make modules_install

mount /boot   (only if you have a seperate /boot partition)

cp arch/i386/boot/bzImage /boot/<nice_meaningful_kernel_name>

Do not use bzImage for <nice_meaningful_kernel_name>, you will really wish you hadn't overwritten your old kernel one day. The arch/i386 is right for all 32 bit Intel compatible chips. I don't know id AMD_64 is any different.

Now fix grub.conf, so we can choose which kernel to boot, after all, there may be a configuration error in the new one. Open /boot/grub/grub.conf in the editor of your choice. Copy the block of lines for your most recent kernel (like this) to the end of the file. This example is one of mine

title=Kernel 2.6.11-gentoo-r4

root (hd0,0)

kernel (hd0,0)/2.6.11-gentoo-r4 root=/dev/md1 hdc=ide-scsi hdd=ide-scsi

Edit the bits in bold in the copy as follows:-

The title= is used in grubs menu and is for you - put anything you like here

The 2.6.11-gentoo-r4 is the name of the kernel file <nice_meaningful_kernel_name>above. Grub will give Error 15 if this is wrong.

If you have some initrd junk, its no longer needed and should be removed.

Now its time to reboot and choose your new entry in grubs menu ....

----------

## adaptr

I personally always use

```
make install
```

to install the kernel.

It copies the kernel image, the config, and your system.map to your /boot dir, all with unique names, and updates or creates symlinks to vmlinuz, System.map and config, as well as .old versions of all these, which get linked to the previous versions that were there.

If you set up your boot loader to always allow you to boot from both vmlinuz and vmlinuz.old, you never have to change your bootloader config  :Wink: 

Yes, it does both GRUB and LILO.

----------

## jonnevers

 *NeddySeagoon wrote:*   

> bigjohn,
> 
> Do not use bzImage for <nice_meaningful_kernel_name>, you will really wish you hadn't overwritten your old kernel one day. The arch/i386 is right for all 32 bit Intel compatible chips. I don't know id AMD_64 is any different.
> 
> 

 

just adding an edit:

AMD64 64bit (and I'm sure intel's x86_64) kernels get compiled into arch/x86_64

----------

## herkusPT

Thanks so much for your help

----------

