LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Kernel Panic: No init found. (mandrake) (https://www.linuxquestions.org/questions/linux-general-1/kernel-panic-no-init-found-mandrake-170990/)

corvus2 04-16-2004 01:35 PM

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.

e1000 04-16-2004 02:21 PM

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?

corvus2 04-16-2004 02:31 PM

Linux is on the external HD and i used the option in the mandrake installation to reformat the entire HD for linux.

ekman 04-17-2004 01:41 AM

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

corvus2 04-20-2004 08:06 AM

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.

corvus2 04-21-2004 09:08 AM

Anyone?


All times are GMT -5. The time now is 05:11 AM.