# Upgrading kernel, no screen, kernel panic.

## Mogusha

Hello,

So, I have an old laptop I'm using as a server. Unfortunately, a long while ago the video card fried and I no longer have use of the screen. I decided to install gentoo on it and make it into a file server amongst other things. I've had everything working perfectly fine for the last few years running on 2.6.34-r6. I spent some time customizing it, but mostly left the default kernel configuration.

Slightly more than a year ago I wanted to update the kernel, so I compiled and tried to get it booted, but it never wound up running. I tried a custom compile and one compiled using genkernel, neither worked. I didn't spend too much time on trying to get it to work though, and just kept using the old kernel.

Now, that it's been quite a while since I upgraded the kernel I tried to be lazy and go the genkernel way again. So, we get to my problem.

I've compiled a kernel using genkernel defaults using kernel 3.5.7. I've tried numerous different grub configurations as well. I'll list the grub menu.lst configurations and what happens in grub comments.

```

default 0

timeout 30

# Boots fine, kernel I use currently.

title Gentoo

root (hd0,1)

kernel /boot/kernel-custom-2.6.34-r6 root/dev/hda3

# Seems to boot, but probably kernel panics.

title Gentoo3.5.7

root (hd0,1)

kernel /boot/kernel-genkernel-x86-3.5.7-gentoo root=/dev/ram0 real_root=/dev/hda3

initrd /boot/initramfs-genkernel-x86-3.5.7-gentoo

# Seems to boot, but probably kernel panics.

title Gentoo3.5.7

root (hd0,1)

kernel /boot/kernel-genkernel-x86-3.5.7-gentoo real_root=/dev/hda3

initrd /boot/initramfs-genkernel-x86-3.5.7-gentoo

# Results in flashing caps lock LED indicator.

title Gentoo3.5.7

root (hd0,1)

kernel /boot/kernel-genkernel-x86-3.5.7-gentoo root=/dev/hda3

# Results in flashing caps lock LED indicator.

# and yes, to be fair I know that an initrd is needed when using real_root to redirect the real kernel.

title Gentoo3.5.7

root (hd0,1)

kernel /boot/kernel-genkernel-x86-3.5.7-gentoo real_root=/dev/hda3

```

I'm not really sure what to do at this point as dmesg only displays the last boot and I have no way of seeing the actual output on a screen. I can always just keep using the old configuration, but I'd like to update at some point.

I doubt I've given enough information to find a problem immediately, any help on what to try next would be greatly appreciated.

Thanks,

Mogusha

----------

## NeddySeagoon

Mogusha,

Welcome to the Gentoo Forums.

This is going to be difficult without some error messages.  You have a few options.

Can you plug in a video card, just for investigations?

Any card made since 1998 will do.

Use a serial console (genkernel supports that).  You will need another system with a serial port and an null modem cable to connect the two PCs together.

The kernel also supports network console (the console over the network).  I'm not sure how useful that is as it requires the network to work.

----------

## Mogusha

Thank you for the welcome.

I agree it will be difficult to diagnose, hence the reason why I'm asking for advice here.

A video card might be possible, but I'd need to find an express card variety as this is a laptop.

Also, since it's one of those crappy acer aspire 5100's it doesn't have a serial port. Unless you meant USB, is that even possible? https://www.kernel.org/doc/Documentation/serial-console.txt and http://cateee.net/lkddb/web-lkddb/USB_SERIAL_CONSOLE.html seem to indicate yes. In which case I'm not sure how to go about setting that up, the last time I tried connecting two computers by usb (I was very young and stupid  :Razz: ) I got a bunch of errors. Or are you suggesting I get a USB to serial cable?

Network over console doesn't seem like too bad an idea as the computer is in a private network with a static IP. I'll look into it since it's the only immediately avaiable option to me at the moment.

Thank you for your rapid response.

Mogusha

----------

## NeddySeagoon

Mogusha,

USB to USB is very expensive as both PCs provide root hubs and you need some electronics in the middle, since USB root hubs won't talk to one another.

In the UK such cables are about £35.

USB to serial might work ... but not until the USB subsystem is started, which can be quite late in the kernel startup process.

You will have to make the USB drivers and the USB to serial converter drivers built in as there is unlikely to be any chance to load modules.

Lets try some showstoppers that have changed in the kernel configuration. These options must be set as shown. 

```
[ ] Enable deprecated sysfs features to support old userspace tools

 < > ATA/ATAPI/MFM/RLL support (DEPRECATED)  --->

  │ │    [*] Maintain a devtmpfs filesystem to mount at /dev                       │ │  

  │ │    [*]   Automount devtmpfs at /dev, after the kernel mounted the rootfs
```

Three of them interfere with udev, so you don't get any device nodes in /dev if they are wrong.

```
<*> Serial ATA and Parallel ATA drivers  ---> 
```

must be on and so must the submenu options for your hard drive chipset. 

Your grub.conf shows :-

```
# Boots fine, kernel I use currently.

title Gentoo

root (hd0,1)

kernel /boot/kernel-custom-2.6.34-r6 root/dev/hda3 
```

 but when you set  

```
< > ATA/ATAPI/MFM/RLL support (DEPRECATED)  --->
```

to off, all of your /dev/hd* nodes go away.  with moderen udev, they have already been removed anyway.

With the new drivers under <*> Serial ATA and Parallel ATA drivers  --->, your hard drive will be /dev/sda (yes, with a SCSI name) and your /etc/fstab will need to be updated too.

In genkernel you have

```
 kernel /boot/kernel-genkernel-x86-3.5.7-gentoo root=/dev/ram0 real_root=/dev/hda3 
```

 but genkernel has been updated to know all of these things.

The downside is that you have only one shot at this, since if you change /etc/fstab and it doesn't work, you have no way to see what you are doing to fix it.

Changing grub.conf is safe - you can add

```
title Gentoo3.5.7 with SATA Drivers

root (hd0,1)

kernel /boot/kernel-genkernel-x86-3.5.7-gentoo real_root=/dev/sda3

initrd /boot/initramfs-genkernel-x86-3.5.7-gentoo 
```

to the bottom of grub.conf and step to it and choose it blindly.

As /etc/fstab still references the old partition names, I expect the boot will fail at rootfsck, as it will try to check /dev/hda3 and fail.

If this happens, the error message with be 

```
Press Ctrl-C to continue or give the root password for maintainence.
```

 You will hear the hdd stop.

Proceed as follows:-

Give the root password

```
mount -o remount, rw /
```

to get root read write.

Now you should be able to start networking and sshd (again blind) and try to log in over ssh.

As root was read only when services tried to start, many will have failed. Once you can ssh in, you can start them by hand.

----------

## Mogusha

Thanks for the suggestions Neddy,

I think I'm going to try and first set network logging console support in the kernel first and see if I can get any output to work with before I start screwing with my /etc/fstab and make it impossible to boot my system. I don't have a recovery disk at the moment as I moved a few weeks ago and haven't yet moved those over yet. Once I get one I can play a bit more without fear of making my system unbootable.

I'll try the grub.conf and blind drive mounting after I see if I can get some network logging to see if that is the problem.

When did the drive names change? This may be the same reason I never managed to get the kernel to boot ever so long ago too.

The sd* and hd* naming has always confused me. Not why the system names them as such, but why the naming convension keeps changing. I've had systems where the hard drive label has changed from hda to sda then to sdb and back again to hda during an install.

----------

## NeddySeagoon

Mogusha,

Console over the network requires a kernel rebuild. It also requires that the kernel can export the console over the network without root being mounted

Playing with grub.conf and getting root mounted read/write is a lot less trouble and it makes no irreverable changes to your system.  That is, the original entries in grub.conf will still work. 

Also we can be certain that the swap from hda3 to sda3 is a major contributor to your problem.

----------

