[oclug] newbie question re debugging kernel panic

Bill Strosberg oclug_mail at strosberg.com
Thu Sep 1 22:08:48 EDT 2005


Adrian Irving-Beer wrote:
> On Thu, Sep 01, 2005 at 05:15:27PM +0000, ed stuckems wrote:
> 
> 
>>I've built a custom kernel and it fails to boot reporting "kernel
>>panic - not syncing: Attempted to kill init!". Once this happens the
>>system is dead and there's nothing available to probe the system.
> 
> 
> For panics at startup, I've found that usually the messages
> immediately beforehand will make it clear what the problem is.
> 
> At this stage, particularly before finding the root partition, the
> kernel is very "fragile" and expects everything to go just right; any
> problems will likely result in a panic, since there's not much else
> for it to do.
> 
> Common culprits include failing to compile-in support for your hard
> drive controller (typically IDE) or your root filesystem (typically
> ext2/ext3); these cannot be modules, unless you use an "initrd"
> system.  Failing to correctly specify the root partition in the kernel
> command line will also cause a panic.
> 
> As far as I know, there's really nothing further you can do except
> read messages at this stage.  It's too early for any software to
> be loaded.
> 
> If the error is occurring further down, after "init" has started,
> then you can try specifying "init=/bin/sh" in your kernel command
> line.  This will replace the standard bootup procedure with a simple
> shell prompt.  You can run stuff individually and see what is causing
> the panic.
> 

Everything above is true, but I've also found that if you change the
drive location (hda versus hdb, hdc versus hdd etc.) the kernel looks
for the root partition in the wrong place - make sure the root reference
in the lilo/grub is aimed at the correct device.

Kernel panics at the exact location you specify is usually due to
failure to find the root partition due to device unavailability.  The
system starts the boot process, and fails to mount the root partition.

--
Bill Strosberg


More information about the OCLUG mailing list