[CentOS] changing motherboards. kernel panic.

Tue Apr 3 16:17:53 UTC 2007
Jay Leafey <jay.leafey at mindless.com>

Erick Perez wrote:
> Hi,
> I just changed the motherboard of a centos 4.4 installation for a new 
> one. this new one has a SIS chipset.
> Now when i boot from the hard disk i get a kernel panic (unable to find 
> root, no hdd found , etc)
> 
> I have identified the module I need to load to make centos "see" the 
> disks. Now the question is what do I need to modify in my existing 
> installation, to tell centos to use the new sis module and to *not* use 
> the old intel?
> 
> Thanks,

I recently had to do pretty much the same thing, i.e. moved a hard drive 
from an Intel-chipset-based box to an AND-64 box with an nVidia chipset. 
  The error you are getting is probably because your initrd file does 
not contain the driver for hard drive controller on the new motherboard. 
  This is pretty much expected if you are using SATA or SCSI drives and 
change motherboard chipsets or disk adapters.

The basic steps to fix this are (1) identify the required storage 
driver, (2) modify the modprobe.conf file to reflect that driver, and 
(3) rebuild the initial RAMdisk file.  To do this you need to boot the 
first disk of your CentOS distribution disk in rescue mode.

As mentioned, boot the system up using the first disk of the 
distribution (or the DVD or the single-disk server CD).  At the boot 
prompt, enter 'linux rescue'.  Note the messages while it loads drivers 
and you should see it load the storage driver for your storage adapter 
(usually in a white box on a blue screen).  You'll need this later. 
Don't bother starting the network interface yet, but do let it mount the 
existing CentOS installation.

If you didn't notice the driver loading, use the 'lsmod' command from 
the command prompt to get a list of loaded drivers.  You should be able 
to figure it out from that.

Next change your default directory to /mnt/sysimage/etc and look at the 
file modprobe.conf.  You should see a line with something like 'alias 
scsi_hostadapter {something}' that defines the primary SCSI/SATA 
adapter.  You should substitute the driver for the disk drive controller 
for {something}.  You might also comment out some of the other stuff, 
like USB controller or sound cards, but kudzu should take care of them 
later.

Next you need to rebuild the initrd file.  You need to chroot to the 
mounted original installation by issuing the command 'chroot 
/mnt/sysimage'.  Now issue the command 'cd /boot' to get to the correct 
directory.  You should see the kernel and initrd files there.  If not, 
something went wrong earlier on and you should retrace your steps.

You should now move the old initrd file out of the way use the mkinitrd 
command to rebuild the initrd file for the kernel you intend to boot. 
The format is:

     mkinitrd {initrd filename} {kernel version}

If you are using kernel 2.6.9-42.0.10.EL, use 'mkinitrd 
initrd-2.6.9-42.0.10.EL.img 2.6.9-42.0.10.EL'.  If you get an error 
stating the file already exists, just move the old one out of the way 
(mv initrd-2.6.9-42.0.10.EL.img initrd-2.6.9-42.0.10.EL.img.old) and 
rerun the mkinitrd command.

You are just about done now.  Exit out of the chroot enviromnent using 
the 'exit' command, then do a clean shutdown of the rescue environment. 
  Remove the CD, reboot the box, and you should get past the kernel 
panic.  I would recommend that you bring the box up in single-user mode 
the first time just to make sure nothing gets started that might "belch" 
on you because of misconfigurations.  Kudzu should run automatically and 
will probably mention that a LOT of hardware devices no longer exist, 
just tell it to delete their configuration and let it finish up.  Once 
you get to the command prompt you can examine /etc/modprobe.conf to see 
the changes it made.  If all your partitions appear to be mounted, 
reboot again and you should be good-to-go.

This is pretty general and I almost certainly have left out some 
details.  Perhaps others on the list could fill in some of the blanks.

Hope that helps!
-- 
Jay Leafey - Memphis, TN
jay.leafey at mindless.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 4011 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.centos.org/pipermail/centos/attachments/20070403/de526ca9/attachment-0005.bin>