LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 04-16-2004, 01:35 PM   #1
corvus2
LQ Newbie
 
Registered: Apr 2004
Posts: 4

Rep: Reputation: 0
Kernel Panic: No init found. (mandrake)


Hi i'm a noob here and trying to get linux working. Here is my setup: I have a laptop and an external USB HD. I installed mandrake with the lilo boot loader on the external HD and have my bios setup to boot from USB before internal HD. I installed Mandrake 10.0 community with no problems. When i reboot lilo works, but when i try and select linux it starts loading then after a few secs gives me the "Kernel panic: no init found. try passing init= option to kernel". This doesn't give you a prompt or console or anything just freezes. If i select windows it boots fine or if i unplug the usb HD windows boots fine without lilo even showing up, which is what i want.

Here's what i've tried:
I've hit escape while loading lilo and at the "boot=" prompt i've tried "linux root=/dev/sda/" and "linux init=/bin/bash" both ended up giving me the kernel panic. I tried using the first install disk as a rescue disk and got a console where i tried "root=/dev/sda/" and "init=/bin/bash"

Any suggestions would be thoroughly appreciated.
 
Old 04-16-2004, 02:21 PM   #2
e1000
Member
 
Registered: Oct 2003
Location: California
Distribution: Ubuntu
Posts: 582

Rep: Reputation: 30
root=/dev/sda/

um, somebody correct me if im wrong, but wouldnt it be 'sda1' or 'sda2', not 'sda/'

what partition is linux on, and are you using a SCSI hard drive?
 
Old 04-16-2004, 02:31 PM   #3
corvus2
LQ Newbie
 
Registered: Apr 2004
Posts: 4

Original Poster
Rep: Reputation: 0
Linux is on the external HD and i used the option in the mandrake installation to reformat the entire HD for linux.
 
Old 04-17-2004, 01:41 AM   #4
ekman
Member
 
Registered: Apr 2004
Location: Sweden
Posts: 41

Rep: Reputation: 15
Hello,

There is a timing problem (with all kernel versions as far as I know) when you boot
from an external USB-HD (I do). Please check;
http://www.freewebs.com/tsj/bootingUSB_ldp_v0.1.htm
for a kernel patch. The kernel looks for the root fs before the USB-HD is available.

I don't use this patch, but a initial ram-disk ("initrd") instead,
where the important part is something like (from /linuxrc);

while ! mount -r -t ext3 /dev/sda2 /hdroot; do
sleep 2
done
cd /hdroot
pivot_root . initrd
exec /usr/sbin/chroot . /sbin/init <dev/console >dev/console 2>&1

Start with kernel boot options;
init=/linuxrc root=/dev/ram0 ramdisk_size=16384

To describe how to make an initrd is to much for an article in this forum, but check
Documentation/initrd.txt in the kernel source dir. Also some distributions always boot
with an initrd (e.g RedHat), then you can take an existing one and chenge for your
needs.

Regards,
L Ekman
 
Old 04-20-2004, 08:06 AM   #5
corvus2
LQ Newbie
 
Registered: Apr 2004
Posts: 4

Original Poster
Rep: Reputation: 0
Could someone walk me through this kernel patch (I'm a noob and don't understand much of this yet):

5.1.2 Patching the kernel
Make sure the mount_root() function contains the patch for detecting the USB disk. There's a bug for the mount_root() originally. The mount_root() was called before the USB disk being detected and initialized completely hence the mount_root() would fail if the root partition is located in the USB disk. Following is the patch for the 2.4.23 kernel:

--- init/do_mounts.c 2003-11-28 13:26:21.000000000 -0500
+++ init/do_mounts.c.mount_root 2006-01-29 10:45:53.000000000 -0500
@@ -759,6 +759,19 @@

static void __init mount_root(void)
{
+ static DECLARE_WAIT_QUEUE_HEAD (jordi_queue);
+
+ printk ("\n\n\n---------------------------------\n");
+
+ printk (" WAITING FOR A WHILE (1000) \n");
+
+ printk (" TO DETECT THE USB DISK \n");
+
+ sleep_on_timeout (&jordi_queue, 2000);
+
+ printk ("---------------------------------\n\n\n");
+
+
#ifdef CONFIG_ROOT_NFS
if (MAJOR(ROOT_DEV) == NFS_MAJOR
&& MINOR(ROOT_DEV) == NFS_MINOR) {

Check the file init/do_mounts.c to see if it already contains the above patch. If not, save the above patch to a patch file named kernel2.4.23.patch. Then at the root directory of the 2.4.23 kernel source perform the following command to apply the patch:

patch -p0 <kernel2.4.23.patch

Note: In some old kernel sources the __init mount_root() is in fs/super.c. You need to do a similar patch to the above one in that case.

Follow the README at the root directory of the kernel source to build the new kernel.
 
Old 04-21-2004, 09:08 AM   #6
corvus2
LQ Newbie
 
Registered: Apr 2004
Posts: 4

Original Poster
Rep: Reputation: 0
Anyone?
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Mandrake 10 - kernel panic: no init found gary_100 Mandriva 31 07-12-2004 06:04 PM
Kernal Panic: No init found. Try passing init= option to kernel raees Linux - General 12 03-18-2004 11:10 PM
kernel panic: no init found. Try passing init= option to kernel rroorroo Red Hat 7 03-07-2004 04:19 PM
error "Kernel panic: No init found. Try passing init= option Anauj0101 Linux - Newbie 3 05-06-2003 10:18 PM
Compiled own kernel and got: Kernel panic: No init found. Try passing init= option to fbl Linux - General 12 01-14-2003 03:38 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:14 PM.

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