LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 11-08-2007, 12:47 PM   #1
gimecoffee
LQ Newbie
 
Registered: Mar 2007
Location: Oregon, USA
Distribution: Mandriva
Posts: 9

Rep: Reputation: 0
kernel panic when moving drive to new machine[SOLVED]


One of the things I've always like about linux is that for a non-X server installation it was pretty easy to move the hard drives to another machine in the event of a hardware problem. I'm having a little difficulty with 2008 and I'm sure it's just because I'm not understanding something but the boot messages are going by too fast for me to read and once the panic happens I can't use shift+pageup to read them. I'm not getting any answers on Mandriva's forum so thought I'd try here.

Machines are:
AMD Athlon 1700
AMD Athlon 2800
Intel Celeron

I'm doing a truly minimal install with LILO as the boot loader.(Also tried with grub with same results.) It boots just fine on the machine I did the install with but not on the others. (I've done installs on the 1700 and 2800 only.)

What's on the screen when the kernel panic stops it is: (Sorry for any mispellings)

Loading ext3.ko module
Mounting /proc filesystem
Mounting sysfs
Creating device files
Mounting tmpfs on /dev
No resume device specified
Trying userspace resume from suspend.com file
No resume device in suspend.conf
echo: cannot open /sys/power/suspend2/do_resume for write: 2
echo: cannot open /sys/power/tuxonice/do_resume for write: 2
Mounting root filesystem /dev/root with flags relatime
mount: error 6 mounting ext3 flags relatime
well, retrying without the option flags
mount: error 6 mounting ext3
well, retrying read-only without any flag
mount: error 6 mounting ext3
Switching to new root
ERROR opening /dev/console!!!!: 2
unmounting old /proc
unmounting old /sys
switchroot: mount failed: 22
Initrd finished
Kernel panic - not syncing: Attempted to kill init

Any thoughts on what my problem is?
Thx
Rois

Your life is going somewhere whether you have a strategy or not. Experience the High Life. - http://www.sailingthroughlife.net

Last edited by gimecoffee; 03-29-2008 at 02:21 PM. Reason: [SOLVED]
 
Old 11-08-2007, 01:29 PM   #2
kilgoretrout
Senior Member
 
Registered: Oct 2003
Posts: 2,987

Rep: Reputation: 388Reputation: 388Reputation: 388Reputation: 388
It can't find your root filesystem probably because you have the hard drive in a different configuration on the second machine. If it's an ide drive it has to be in the same position on the second box as the first, eg primary master. If it's a sata drive it has to be on the same sata channel as the first.

Hard drives in linux are configured according to where they are on the ide or sata bus. For example, if you installed on the first primary partition on an ide drive on the primary master ide channel, the root partition would be hda1, or possibly sda1 on more recent kernels. If you transfer the drive to a second box and put it on the secondary master channel, it becomes hdc1. Unfortunately, the bootloader is configured to look for the root partition on hda1; when it can't find anything there, you get a kernel panic.
 
Old 11-08-2007, 02:10 PM   #3
gimecoffee
LQ Newbie
 
Registered: Mar 2007
Location: Oregon, USA
Distribution: Mandriva
Posts: 9

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by kilgoretrout View Post
It can't find your root filesystem probably because you have the hard drive in a different configuration on the second machine. If it's an ide drive it has to be in the same position on the second box as the first, eg primary master. If it's a sata drive it has to be on the same sata channel as the first.
Good thought (it is a single IDE drive) but I checked that. It was the primary master (hda) on the installing machine and the primary master (hda) on the second machine and third machine. Actually I've done this quite a lot. Usually with software raid-1 drives and I've never had this problem until mandriva 2008.

I just finished trying it with Mandriva 2007(Spring) on a completely different hard drive (just to make sure it wasn't a drive issue) and was able to move it to several different machines with no problem. It booted right up. Then I tried it with 2008 on the new drive and got the kernel panic again.

There's got to be something new in the linux kernel or something that doesn't like this anymore.

Thoughts
Rois
Your life is going somewhere whether you have a strategy or not. Experience the High Life. - http://www.sailingthroughlife.net

Last edited by gimecoffee; 03-29-2008 at 02:22 PM.
 
Old 11-09-2007, 09:56 AM   #4
gimecoffee
LQ Newbie
 
Registered: Mar 2007
Location: Oregon, USA
Distribution: Mandriva
Posts: 9

Original Poster
Rep: Reputation: 0
In reading the release notes and seeing that the IDE drivers are all done as modules now makes me wonder if this could be an IDE module problem. If the installer is setting up the IDE modules for the MOBO it's on and the the others MOBO's aren't the same then I'm guessing that the kernel would panic trying to load the wrong IDE modules for the MOBO???

Any thoughts on this idea and what I might be able to do to get the correct module to find itself?? (pipe dream???)

Thanks for the input.
Rois

Your life is going somewhere whether you have a strategy or not. Experience the High Life. - http://www.experiencethehighlife.com
 
Old 11-09-2007, 12:24 PM   #5
kilgoretrout
Senior Member
 
Registered: Oct 2003
Posts: 2,987

Rep: Reputation: 388Reputation: 388Reputation: 388Reputation: 388
It's possible. On the newer kernels, I've also seen different device files for drives on different boards using the same distro/kernel. Sometimes the old hdx designation is used for ide drives and other times the new sdx designation is used for the same drive depending on the hardware environment. That alone would cause a kernel panic.
Are you using grub and, if so, can you get to a grub prompt on the non-booting box? If so, there are some things you can try to investigate these possibilities.
 
Old 11-09-2007, 12:28 PM   #6
keratos
Member
 
Registered: May 2007
Location: London, UK.
Distribution: Major:FC8. Others:Debian;Zenwalk; Arch; Slack; RHEL.
Posts: 544

Rep: Reputation: 30
The drive and/or partitions mapping has changed, because as correctly identified above, the drive location is either different or the kernel device mappings from m/b chipsets are different.

with the hard disk in the new machine, boot up and go into grub. Dont load a kernel but goto into the GRUB command line and enter the command

find /vmlinuz

post the output
 
Old 11-09-2007, 02:40 PM   #7
gimecoffee
LQ Newbie
 
Registered: Mar 2007
Location: Oregon, USA
Distribution: Mandriva
Posts: 9

Original Poster
Rep: Reputation: 0
grub>find /vmlinuz
Error 15: File not found

The grub line is:
kernel (hd0,0)/boot/vmlinuz BOOT_IMAGE=linux root=/dev/hda1
initrd (hd0,0)/boot/initrd.img

so I ran this w/ the following out put:
grub>find /boot/vmlinuz
(hd0,0)
grub>find /boot/initrd.img
(hd0,0)

Thoughts?
Rois
Your life is going somewhere whether you have a strategy or not. Experience the High Life. - http://www.sailingthroughlife.net

Last edited by gimecoffee; 03-29-2008 at 02:22 PM.
 
Old 11-09-2007, 05:30 PM   #8
kilgoretrout
Senior Member
 
Registered: Oct 2003
Posts: 2,987

Rep: Reputation: 388Reputation: 388Reputation: 388Reputation: 388
Just for thoroughness, also try:

grub> find /sbin/init

You should get the same output re (hd0,0).

All this indicates the grub mapping is the same so I'm guessing the device file for the root partition changed from hda1 to sda1. To test that, run this at the grub prompt:

grub> root (hd0,0)
> kernel /boot/vmlinuz root=/dev/sda1
> initrd /boot/initrd.img
> boot
And see if it boots. If it does, I'm right.

Last edited by kilgoretrout; 11-09-2007 at 05:42 PM.
 
Old 11-09-2007, 06:51 PM   #9
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,124

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Probably crossing 2.6.19 with the libata changes that caused the device designation to change from /dev/hd? to /dev/sd?

If you're having problems with the switchroot, the initrd will need to be rebuilt as well as changing the bootloader config and fstab (probably).
Different distros handled this variously; redhat/Fedora used LABEL in place of the device designation, Ubuntu went with UUID. Never used Mandriva (gave up on Mandrake (10) when it ate my partition table) so I don't know their direction.
 
Old 11-10-2007, 04:09 AM   #10
keratos
Member
 
Registered: May 2007
Location: London, UK.
Distribution: Major:FC8. Others:Debian;Zenwalk; Arch; Slack; RHEL.
Posts: 544

Rep: Reputation: 30
Quote:
Originally Posted by kilgoretrout View Post
Just for thoroughness, also try:

grub> find /sbin/init

You should get the same output re (hd0,0).

All this indicates the grub mapping is the same so I'm guessing the device file for the root partition changed from hda1 to sda1. To test that, run this at the grub prompt:

grub> root (hd0,0)
> kernel /boot/vmlinuz root=/dev/sda1
> initrd /boot/initrd.img
> boot
And see if it boots. If it does, I'm right.
This is a good bet. Provided the sata drivers are loaded natively or in the initrd image !
 
Old 11-13-2007, 12:24 PM   #11
gimecoffee
LQ Newbie
 
Registered: Mar 2007
Location: Oregon, USA
Distribution: Mandriva
Posts: 9

Original Poster
Rep: Reputation: 0
Thank you for the suggestions. Following your instructions . . .

grub> find /sbin/init
Shows: (hd0,0)

grub> root (hd0,0)
Shows: Filesystem type is ext2fs, partition type 0x83

> kernel /boot/vmlinuz root=/dev/sda1
Shows: [Linux-bzImage, setup=0x2000, size=0x18a858]

> initrd /boot/initrd.img
Shows: [Linux-initrd @ 0xffbd000, 0x2e5ec bytes]

> boot
Gives same kernel panic after a bunch of boot messages I can't see.

Just for giggles I did it for hda1 as well (I was guessing this is the manual way of booting grub) and it still gave a kernel panic.

This is getting pretty frustrating. Any other thoughts I could try.

btw keratos . . . there is no SATA on any of these MOBOs. Only IDE.

Thx
Rois

Your life is going somewhere whether you have a strategy or not. Experience the High Life. - http://www.experiencethehighlife.com

Last edited by gimecoffee; 11-13-2007 at 12:27 PM.
 
Old 11-13-2007, 01:50 PM   #12
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,337

Rep: Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548
I think that syg00 had the right idea when he said to rebuild the initrd. If you need different kernel modules loaded for the different IDE chips on the two motherboards then you need a different initrd for the second motherboard.

I am uncertain how to do that. One way might be to pack the module for the second motherboard IDE chip into the first initrd even though the first initrd doesn't need that module for the first motherboard. You might try using the --with option in mkinitrd to add an extra module to the first motherboard's initrd.

----------------
Steve Stites
 
Old 11-14-2007, 02:24 AM   #13
keratos
Member
 
Registered: May 2007
Location: London, UK.
Distribution: Major:FC8. Others:Debian;Zenwalk; Arch; Slack; RHEL.
Posts: 544

Rep: Reputation: 30
This article (although not specifically on initrd images) does include some detail on how to create initrd for mandriva (which appears on your sidebar signature): http://mandrivausers.org/lofiversion...hp/t23958.html

Moreover the problem most likely related to chipsets and hardware changes on the motherboard - there are many components on a m/b that dont seem initially obvious: APIC, north/south chips, sound/vga, memory bus, system bus, PCI interface etc.etc.

Very briefly thinking about your challenge, I would say your options are limited because you need to ensure the correct kernel drivers are loaded for you m/b.

Would it be possible to boot a Mandrake liveCD and copy its /boot/* files onto the HDD ??
or
Still from the LiveCD, "chroot" and "bind" to your HDD / filesystem on the HDD and download from synaptic a kernel package. Because of the chroot+bind the package contents+mods should be written to the HDD filesystems.
 
Old 11-14-2007, 11:27 AM   #14
gimecoffee
LQ Newbie
 
Registered: Mar 2007
Location: Oregon, USA
Distribution: Mandriva
Posts: 9

Original Poster
Rep: Reputation: 0
Thanks guys. Sounds like changing the ide module and rebuilding the initrd was the correct answer. I got this from the mandriva forum so I thought I'd post the solution here in case someone on this forum might find this useful. (Here is the url in case you want the full details:
http://forum.mandriva.com/viewtopic.php?p=399288#399288 )

Quote:
RJ549 (Site Admin, Mandriva):
2008.0 has gone to modular IDE. What that means is that the IDE drivers are insertable modules similar to what has been done with scsi for a long time. In fact, several of the IDE modules actually enumerate drives with 'sda', 'sdb'... as though they are scsi instead of the usual 'hda', 'hdb'... that we're used to seeing.

Do you know what model of IDE controller the panicking machine has?
If so, you can boot the disk in the bootable machine and add that module name to /etc/modprobe.conf. Here's an example:
Code:
alias ide-controller ide_generic

The ide_generic module stands a good chance of working on most IDE controllers and still uses the 'hda', hdb'... nomenclature. For best performance though, it really is best to select the correct module for your particular controller model.

Once you get the correct line added to /etc/modprobe.conf, you need to rebuild the initrd. I've found that the easiest way to do that is to uninstall, the re-install the kernel package. If you only have the one default kernel installed, you'll need to temporarily install another one (like perhaps kernel-desktop586-latest) first.
Thx
Rois
Your life is going somewhere whether you have a strategy or not. Experience the High Life. - http://www.sailingthroughlife.net

Last edited by gimecoffee; 03-29-2008 at 02:22 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Kernel Panic after moving partitions GoldenPenguin Linux - General 9 08-31-2006 09:53 PM
Mandriva - Not Booting After Moving Hd, kernel panic Quaxo Linux - General 3 12-03-2005 06:13 PM
Kernel Panic, Machine Check exception tinksmartbstupi Linux - Software 5 11-16-2005 03:18 PM
Moving from hdc to hda - Kernel panic goozlq Linux - Hardware 5 08-31-2005 06:06 AM
Kernel Panic: Resume Machine: Unable to find suspended-data signature ( - mispelled? ToddM Linux - General 1 09-30-2004 10:59 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 02:01 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration