LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-16-2007, 12:57 PM   #1
linux_marine
LQ Newbie
 
Registered: Sep 2006
Posts: 7

Rep: Reputation: 0
Boot time kernel panic after cloning distro to differnt disk


Hi there,

I used to have a mandriva 2007 running on an IDE hard disk, and then had to get a new disk because the old one is obviously dying. To avoid great amount of time on re-compiling many programs I have installed over time, I decided to clone the distro from the old disk instead of doing a clean installation on the old one.

Here is the scenario: the old hd is an IDE disk therefore gets assigned as /dev/hda by mdk, and the new one is a sata disk then as /dev/sda. I used partimage to backup the partitions on the old one and than restore the images to the new disk. Then I modified the /etc/lilo.conf and /etc/fstab on the new sata disk (basically changing anything refering /dev/hda to /dev/sda), reinstalled lilo, and boot up the machine.

The bootloader came up successfully and went on trying to boot the mdk distro on the sata disk. Unfortunately it reported that, because not being able to find the /dev/root device, it encountered a kernel panic and failed. I did some research around and was told that /dev/root was a symbolic link, but obviously the link is not a static link. So is there any way to tell the distro now the /dev/root should be /dev/sda instead of /dev/hda? Of I really have to do an installation from the beginning?

Thanks for anybody that could give me a pointer.
 
Old 06-16-2007, 01:59 PM   #2
Valkyrie_of_valhalla
Member
 
Registered: Jan 2006
Location: Romania
Distribution: Suse 12.0, Slackware 12.1, Debian, Ubuntu, Gentoo
Posts: 301

Rep: Reputation: 30
If that's the only problem, you could try modifying the link with a live cd, eg. Knoppix.

Just put it in, open a terminal and type in:

su
ln -s /dev/sda /dev/root

And I guess you should remove /dev/root first (rm /dev/root I think)...

It might also be from the bootloader... What are you using? Grub or LILO? If just modifying the link doesn't work, you should check your bootloader's config file too...
 
Old 06-16-2007, 03:24 PM   #3
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 112Reputation: 112
You need to list here the output of

(1) fdisk -l

(2) /etc/lilo.conf

so that the problem may be diagnosed
 
Old 06-19-2007, 11:46 AM   #4
linux_marine
LQ Newbie
 
Registered: Sep 2006
Posts: 7

Original Poster
Rep: Reputation: 0
hi, I managed to do the movement onto the SATAII drive. Just in case anyone would be interested, I listed my steps here.

As a nice knowledgable person has hinted, the reason that the kernel can not find the root drive is probably that the original startup kernel on my old IDE drive does not recognize the sata drive. This was correct because my kernel, i.e. the default Mandriva 2007 distro one, does not have compiled support for sata and needs external driver modules to access sata drives. And when I installed the distro on the IDE drive, the installer did not put in the necessary sata drivers (for the minimum startup kernel image vmlinuz) thus the vmlinuz, when it tried to access the new SATAII disk, failed and reported a panic.

So here is what I have done:
1. do a fresh installation of mandriva 2007 on the sata drive (just take the minimum packages to save time)
2. save the following files and folders
/boot (actually I just need the vmlinuz image but I save the whole folder anyway)
/etc/lilo.conf (probably would be different if you use grub)
/etc/fstab
3. now I clone the old IDE disk onto the SATAII disk again
4. put the files and folders I just backuped back to place and overwrite the existing ones
5. reinstall lilo again.

then I reboot the machine and everything is fine.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
pacman -Su, kernel upgrade, kernel panic, change distro? jkh Arch 35 03-10-2006 02:14 AM
cloning disk using cp - no special devices for target disk vulture99 Linux - General 6 05-08-2005 06:36 PM
[2.6.11 just compiled] kernel panic at boot-time MD3 Slackware 10 04-24-2005 12:39 PM
Cloning boot disk using DD vanibhat Linux - Hardware 3 12-01-2004 04:35 PM


All times are GMT -5. The time now is 10:30 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration