# [Resolved] Kernel panic : No init found...



## pvc9 (Jul 7, 2002)

Hi all,
System Specs - AMD Duron 1 GHz, 256 MB SDRAM, 2 HDDs, 2 CDDs.

One of the HDDs is 40 GB, the other is 2 GB. As I had only one jumper, I couldnt connect all the drives at once. So I had to disconnect the 40 GB HDD, make the 2 GB HDD master, install RH Linux. Hope this is clear. I installed Linux with _only_ the 2 GB HDD connected!

So, if I had to work with Linux I had to disonnect the 40 GB HDD and make the 2 GB HDD master...

Recently I got few jumpers from my friendp) so I changed the settings, connected all the drives. Now the setup is -

Primary Master - 40 GB HDD
Primay Slave - CDROM Drve

Secondary Master - 2 GB HDD
Secondary Slave - CD Writer

When I boot through the 2 GB HDD, I get the bootloader(GRUB), the booting process continues for few seconds but it stops and the error message dsiplayed is -

_Kernel panic : No init found. Try passing init= option to kernel_



Have searched on the net about the same, found some info but still 



> Boot using linux init=/bin/bash, and then check that /etc/fstab is not corrupted, that /sbin/init is still there. Also check /etc/inittab for errors, but I do not expect that to be the problem.
> 
> Unless /etc/fstab shows corruption, I would suspect that the box was cracked by someone that didn't realy know what they were doing, and they goofed...
> ---------------------------------------
> ...


I used the bootable Linux Cd, started the Rescue mode...got the shell, looked in Grub.conf...lost.

I can re-install the OS in less than 15 minutes but thats the last option...

TIA!


----------



## lynch (Aug 3, 2002)

I think grub is looking for init on hda3 which is where the root directory should be if the drive is partitioned like this:
hda1=/boot
hda2=swap
hda3=/ (/=root directory)
You have changed it to hdc,which in Linux is secondary master.It cant find init because grub is not being told the right place to look.Remember that grub uses the zero system to identify drives.
The easiest way I guess is to put the 2GB back to primary master so it will boot and then edit the drive designations in grub to reflect the move to secondary master. Then switch the drive back to secondary master.
Example:if your menu.lst or grub.conf looks like this:
default=0
title = Linux
root = (hd0,1)
kernel = /boot/vmlinuz
title = Windows
chainloader = (hd0,0)+1

Change the * root = (hd0,1) to root=(hd2,1)
*
The hd0 is what Grub call hda;the 1 after the comma(hd0,1) is the partition.
Now you'll have to edit grub and fstab to sort out all the drives.If you havent moved the cdrom and burner you only have to edit the listings for your hdds.
Once you put the drive on primary master and boot to linux check your /etc/fstab to check your drive designations there and change the dev/hda entries to hdc.Also check the partitions to see how many you have.
You may be right:it might be faster to reinstall but there may be a good chance this fix may work
I think it will.  
lynch


----------



## pvc9 (Jul 7, 2002)

Thx so much lynch 

Ok! I disconnected the 40 GB HDD and made the 2 GB the Primary Master. Didnt change a thing, when I start the computer, GRUB loads, when I hit the enter key I get this error message -

_Booting 'Redhat Linux(2.4.7-10)'

root(hd 0,1)
Filesystem type is ext2fs, partition type 0X83
kernel /vmlinuz-2.4.7-10 ro root=/dev/hda2

Error 15: File Not Found

Press any key to continue...
_

The contents of grub.conf/menu.lst -

_
root(hd 0,1)
kernel /vmlinuz-2.4.7-10 ro root=/dev/hda2
initrd /initrd-2.4.7.img
_

TIA 

PS : Whenever I had problems with Linux previously, all I did was re-install, now no more re-installations, have to learn some troubleshooting too 

edit : BTW, I just wanted to add that I'll be making this disk the Primary Slave...so it wont be Secondary Master...sorry lynch but the cables here are really short... Have to change it. Morever the CDDs' setup will also change, the CDROM will be the Secondary Master and CD Writer the Secondary Slave...

So the hda will be hd*b* right? TA


----------



## lynch (Aug 3, 2002)

If you were putting the 2GB hdd with Linux back to primary master when you wanted to work in Linux and were able to boot before,then I'm not sure why it would give an error now.What the error means,in this case,is that grub cant find the specified filename.If you dont get a menu at startup,then the "file not found" is probably grub.conf.Does it boot to linux after you press a key to continue?After moving the 2GB hdd to it's final place you can try reinstalling grub:At the grub prompt type:
root ( hd1,1) 
(hd1 being primary slave,1 being second partition)
Then:
setup (hd1)
And it should regenerate grub.conf
lynch


----------



## pvc9 (Jul 7, 2002)

Sorry for the delay lynch!

Ok, this is what I did. I disconnected the 40 GB HDD, connected only the 2 GB HDD, same error, the system boots till GRUB, when I press the Enter key I get the same error msg...

_Booting 'Redhat Linux(2.4.7-10)'

root(hd 0,1) 
Filesystem type is ext2, partition type 0X83 
kernel /vmlinuz-2.4.7-10 ro root=/dev/hda2

Error 15: File Not Found

Press any key to continue..._

Not sure if I did the right thing, I changed the setup totally and made the 2 GB HDD Primary Slave. So now its hdb, right?

Next, I used the bootable Cd and started the Linux Rescue mode, used the chroot command...got to the Shell. At the Shell I tried these -

1) Edit the /etc/fstab file.

There was only one line with the hda, it was hda3 for the swap partition. So changed it to hdb3. For the root and /boot there was just the LABEL=/ and LABEL=/boot. Anything I should change here?

2) Edit the /boot/grub/grub.conf.

Now grub.conf looks like this -

root (hd 1,1)
setup (hd1)
kernel /vmlinuz-2.4.7-10 ro root=/dev/hdb2
initrd /initrd-2.4.7.img
init=/dev/hdb2/sbin/init

3) Executed the grub-install script.

Hope I did things the right way...learning all the way! Thx to you 

I restarted the computer and I get another error message.

Grub loading please wait...

Error 22

I found this regarding Grub 2 Error 2 - GRUB Errors



> 22 : "Must load Multiboot kernel before modules"
> This error is returned if the module load command is used before loading a Multiboot kernel. It only makes sense in this case anyway, as GRUB has no idea how to communicate the presence of location of such modules to a non-Multiboot-aware kernel.




TIA!


----------



## lynch (Aug 3, 2002)

Well,what it's saying is,because you installed Linux on it's own drive and the 40GB wasnt hooked up,it didnt detect another OS so it didnt install the kernel with multi-booting compiled into it.It just installed a standard kernel that supports booting Linux.
You might want to take that fifteen minutes and reinstall.It'll set things up properly instead of trying to boiler-plate everything together afterwardsOr recompiling the kernel 
Believe me,it's the best way. 
lynch


----------



## pvc9 (Jul 7, 2002)

*15 minutes* 

Ok lynch, I thought so...all those errors...oh well I could just re-install it 

TA...atleast I made a beginning in the troubleshooting world of Non M$ OS! 

Merry Xmas and a Happy New Year to you and yours 

Have a great time!


----------



## lynch (Aug 3, 2002)

For sure,Merry Christmas! 
I might try compiling a new kernel over the holidays(I'm off til' 2003 ).If I do,I'll post my adventures.
Let me know how the re-install goes
Peace on Earth
lynch


----------



## pvc9 (Jul 7, 2002)

Hi lynch,
Re-installed the OS. Everything fine now...

Hey thats great! Compiling a new kernel...cool!!! Plz post about the trials...that'll be fun at the same time very useful! 

Almost forgot...one last(for now ) q lynch. I've a problem with the monitor or I donno. I just hear this high frequency sound all the time, OMG...a real pain. Had the same problem in Windows too, its OK in CUI. The problem is only with GUI. How can I change the refresh rate...frequency of the video card/monitor? In Windows I could change it through the Desktop properties...thats so easy, but this is Linux. How can I?  

Have a great time! 

TA!


----------



## lynch (Aug 3, 2002)

Is the sound coming from the monitor?If the monitor is doing that,it could be any number of things-none all that good.
I think in RH 8 you run Xconfigurator,I believe.
lynch


----------



## pvc9 (Jul 7, 2002)

I guess so, the sound seems to be coming from the monitor. Will switch to Linux now, try the Xconfigurator and post back...

I just checked it in Windows, its something related to the Video Adapter...when I set the Refresh Rate to 60 Hz no sound and it works fine. If I use the default/optimal setting I hear that sound 

Will try in Linux and post back. TA!


----------



## unolinuxguru (Jan 4, 2003)

I just encountered the same problem on a fresh Knoppix 2002-12-12 beta install to my hard drive... it installed just fine, rebooted, and worked wonderfully. I came back days later, rebooted, and was welcomed with a kernel panic!

It looked ugly...
hda: read_intr: status=0x51 {DriveReadySeekComplete Error}
hda: read_intr: error=0x10 {SectorIdNotFound}, LBAsect=256657742 sector=2
... quite a bit of that...
Ext3-fs: unable to read superblock
mount: invalid argument
Freeing unused memory....
Kernel panic: No init found. Try passing init= option to kernel

So I tried some of those boot parameters (/bin/sh, /bin/bash/, option) but it didnt help... popped back in the Knoppix 3.1 cd and tried to mount the drives manually... got those same errors as above.

Then ran "cfdisk" to reexamine the partitions, and I had made a mistake in partitioning it seemed. I had:
hda1 Primary Linux 16mb (to be a /boot, but never got labeled)
hda2 Primary Linux swap 255mb
hda5 Logical Linux ext3 10gig (my / partition)

!! changed hda5 to be bootable and not hda1 fixed it

my error was in making hda1 bootable, since the knoppix install (knx-hdinstall) hadn't reformated the drive apparently, I noticed when trying to boot hda1 that it was asking for the windows command interpreter (installed previously). So wow, that was simple... and I thought I had a bad harddrive or something. =) 

hope that might help someone who made the same silly mistake as me. peace.


----------



## lynch (Aug 3, 2002)

Hi and welcome,unolinuxguru.I love those probs that make you pull out huge clumps of hair and then realize later it was somthing simple  
Thanks for sharing the solution to that very similar problem.
lynch


----------

