kernel panic when changing boot location from hdb to hdd
I move hard drives all the time.
If I move the drive from hdb to hdd, I get a kernel panic error.
How can I have linux autodetect where the
drive is at startup?
Linux OS Simply Mempis 3.3.2
Pentium II 400 mhz
You are getting the kernel panic because it cannot find the root partition. There are several changes that will need to be made. I'll list everything to check out that I can think of.
1) The kernel image needs to know what the root device is. The command rdev will let you look at that.
Usage is like rdev <kernel image> it should spit up what it thinks the root partition is. You can change that by issuing a command like rdev <kernel image> <new root device> for example rdev vmlinuz /dev/hdd1
2) Look at the entries in your /etc/fstab. Make sure all those seem accurate. This is the table which lists the filesystems to mount and where. You would be looking for entires that say something like /dev/hdb?, you would need to change them to /dev/hdd? the ? is the partition and it should stay the same. /dev/hdb1 would be /dev/hdd1 etc...
3) You would also need to change your boot loader also. If you use lilo, the config is in /etc/lilo.conf, if you use grub its probably under /boot/grub/<cant remember name> sorry. Also, if you use lilo and had to make a change using rdev, or to the lilo.conf file, dont forget to reissue the lilo command to update the boot loader.
Down to you next question, I dont think there is a way for linux to just "autodetect" and work. There is more to the booting process than that.
Hope this helps
These are some good clues.
At the moment I can't recall if I get a command line
after the kernel panic.
At that point can I just define and save as hdd?
In the format change hdb to hdd? At a kernel panic
there are not many niceties for doing file editing to
fstab an so on.
Could it be done using System Rescue CD?
If there's no autodetect possible as an autoexec macro, then
I'll need a way to just issue the command manually
for wherever the drive is.
Thanks for responding. This particular maneuver seems a lot more difficult than expected.
-- Also, I tried to get Tom's Rootboot onto a floppy 1.44
from the Windows zipped version and an error issued
saying it was too big. So I've tried to track down all
the options but failed.
No, you probably wont get a commandline prompt after the panic. However, those steps can be performed using a rescue cd. if you use lilo, you might even be able to add a couple of options at boot time. However, im not sure these still work. You could type in the parameters after keying in the boot name.
If your lilo label for your system is linux, type typing linux single root=/dev/hdd, that might get you to a prompt, you could get a bunch of errors, but it might get you to a command line.
Hope this helps
latest news from the kernel panic is not good.
I used the install disk to refresh the grub bookloader
at hdd which the cd found ok.
It said it did the grub process completed successfully
but the progress bar looked flakey when filling in.
The I rebooted and the kernel panic error reappeared.
Did you make changes to the grub configuration. My grub configuration file is at /boot/grub/menu.lst
at typical linux entry is as follows:
title Debian GNU/Linux, kernel 2.6.12-1-686
kernel /boot/vmlinuz-2.6.12-1-686 root=/dev/hdb1 ro
The root line tells you what the root partition is, in this case, it is the 1st partition on the 2nd IDE device.
hd0=primary/master, hd1=primary/slave, hd2=secondary/master, hd3=secondary/slave the partitions are numbered starting at 0.
You will need to change the appropriate line in your configuration. If it hasn't already been done for you. Also look at the "kernel" line where it says root=/dev/hd??. Make sure it is changed to the right drive.
Once done, then you would need to reload the boot-loader, for em that would be
If this doesn't help, get the exact panic message and post it. I am assuming is says something like "Panic.. cannot mount root"
Hope this helps
Ok. I hope we are not working at cross purposes.
the drive on a different machine and got a different
error for video.
The fix for that is supposed to be:
change vga=[number] to vga=normal
I have to try that to get my video going on the other setup.
All this is going on in the command line.
I don't know at this point if I can load an
editor to do any of this stuff without video other
News from this adventure is:
I found where to change vga=791 to vga=normal
on the main grub screen.
Doing this gave the same result: the boot process stops at loading the kde desktop.
The /etc/X11 has the X86 whatevs config for the desktop
rather than xorg-- now I know that Ubuntu uses
xorg and mepis uses XFree86.
To get this going I'll need a really low screen resolution.
Live cds load on this system, but installed to disk
do not so there's something flakey in the video and X
Please don't ask me to use vi.
I do not even know how to exit from it and never did.
To summarize: grub spash screen loads in color etc.
Changing vga to 'normal' still puts me back at
command line and kde cannot load.
From previous attempts, I remember that Gnome Desktop
Manager had the same problem, so it has to be fixed
before any X desktop attempts to load.
I am very patient. We will fix this.
Ok... this is making more sense now. You are not having problems booting, but rather kde is freezing during startup. If this is the case, I suspect that your X configuration has somehow gotten messed up.
The changes you are making at the boot loader don't really affect your X desktop configuration.
We need to find out whether your machine is really freezing or whether X is just hanging during the load. So, boot your system, at the point when kde freezes, or appears to, press the ctrl+alt+f1. There are virtual terminals configured on virtually every linux distro. There are generally 6 of them. If you booted into a text mode, as opposed to X, you could switch terminals by using alt-f1, alt-f2, etc... X typically uses the first available terminal, which is usually 7. But since you are in the X environment, you need to use the ctrl also to switch to a "console" session. If kde is just hanging, then it should bring you to a login prompt (text mode). From there you can re-configure X, or fix your kde environment. Another test might be to use ctrl-alt-backspace. That typically us used to kill X. It would restart X, not the computer, but it would tell you whether or not the computer is completely frozen or kde is just hanging.
If however, your computer is locking up because of this, then we would need to change the configuration and not boot straight into kdm (the kde display manager). This change can be done using a text editor. There are other text editors besides vi. You can try typing joe, or jed, or nano. The file we would need to change is called /etc/inittab. There is a line in there labels initdefault. In previous RH releases runlevel 5 meant full multiuser mode with X, 3 meant full multiuser mode in text mode (non-X).
In order to get there, if you machine is freezing, you would need to append the "single" to you boot loader line. This should boot you into single user mode i.e no X so you can make this change. If that doesnt work, then you can use a rescue cd to make that change.
Let me know what you find.
|All times are GMT -5. The time now is 07:09 PM.|