LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 09-19-2007, 06:39 AM   #1
prakashburla
LQ Newbie
 
Registered: Sep 2007
Posts: 1

Rep: Reputation: 0
Lightbulb kernel panics


Hai,
I have downloaded new 2.6.22.6 kernel and i have done kernel compilation clearly.After kernel compilation,when iam booting to 2.6.22.6 kernel iam getting kernel panics like
mount:error 6 mounting ext3
mount:error 2 mounting none
switching to new device:i.e
switchroot:mount failed:22
umount /initrd/failed:2
not syncing:attempted to kill init!
(even thought i have changed /boot/grub/grub.config file. and /etc/lilo/lilo.config file still iam unable to slove these kernel panics errors can any one explain me what is the reason for these kernel panics and how to slove them)
from,
Prakash
RSA.
 
Old 09-19-2007, 07:17 AM   #2
Okie
Senior Member
 
Registered: Mar 2002
Location: Oklahoma
Posts: 1,154

Rep: Reputation: 187Reputation: 187
did you build filesystem support for ext3 as a kernel module, if you did build filesystem support as a module you will need to make a new initrd.img...

i prefer to build my kernels with filesystem support in to the kernel itself so an initrd.img is not necessary...
 
Old 09-19-2007, 09:08 PM   #3
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,610
Blog Entries: 4

Rep: Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905
A "kernel panic," as you can surmise, is produced when "a situation that cannot possibly happen" ... just did.

The most common symptom that is presented is "attempted to kill 'init'", which is actually a misleading message: it is technically true, but irrelevant.

What has actually happened is that the "init" process, which is hand-built by the kernel when the computer first starts up, has died, or failed to start. (The "init" process is not allowed to die.)

The condition that caused the machine to "grind to a halt" is, as stated, that "'init' has died," but the root cause of the problem is going to be given .. not by this message, but by one or messages which immediately precede it. You'll see the system try to get off-the-ground, falter somehow, and ... "you're dead, Jim."

You can clearly see this here: the system tried to mount the root file-system, failed to do so, and fell-down. (The fact that it tried "mounting 'none'" is also suspicious.)
 
Old 09-29-2007, 06:26 PM   #4
dwhitney67
Senior Member
 
Registered: Jun 2006
Location: Maryland
Distribution: Kubuntu, Fedora, RHEL
Posts: 1,541

Rep: Reputation: 335Reputation: 335Reputation: 335Reputation: 335
Sundialsvcs -

I have a question for you and it seems that you have some valuable knowledge concerning "kernel panics".

I am booting a CD-R containing a custom Linux distro. After grub does its magic to load the kernel, I have a shell script that ultimately launches a Qt application to prompt the operator what to do next (e.g. install the Linux distro, update an existing one, etc.).

Everything works like a charm, up until the point where the CD-R is ejected and then I get the "kernel panic - attempting to kill init". Can you help me try to determine why I am getting this "kernel panic"?

I want to theorize that the kernel panic is caused by something in the script shown below, but I cannot be certain. Also, do have any idea what the "pivot_root" command does (i.e. what purpose does it serve).

Code:
#!/bin/sh
echo Step 1 of 6: Partitioning disk...
fdisk /dev/hda >/dev/null 2>/dev/null << EOF
d
1
d
2
d
3
d
4
n
p
1

+600M
a
1
n
p
2

+256M
t
2
82
n
p
3


w
EOF

echo Step 2 of 6: Setting up and adding swap space...
mkswap /dev/hda2 > /dev/null 2> /dev/null
swapon /dev/hda2 > /dev/null 2> /dev/null

echo Step 3 of 6: Creating filesystems...
mke2fs -jq /dev/hda1 > /dev/null 2> /dev/null
mke2fs -jq /dev/hda3 > /dev/null 2> /dev/null

echo Step 4 of 6: Mounting filesystems...
mount -t ext3 /dev/hda1 /mnt > /dev/null 2> /dev/null

mkdir /mnt/home
mount -t ext3 /dev/hda3 /mnt/home > /dev/null 2> /dev/null

echo -n Step 5 of 6: Installing software...
cd /mnt
for a in /to_install/*gz
do
        echo -n .       
        tar xzf $a
done
echo " "

for a in /etc/fstab /boot/grub/menu.lst
do
        rm /mnt/$a
        mv /mnt/$a.new /mnt/$a
done

cp /etc/version /mnt/etc/version

for dir in ati chips front intel
do
        cp -a /etc/X11/$dir /mnt/etc/X11
done

echo Step 6 of 6: Installing boot instructions...
/to_install/do_install_grub > /dev/null 2> /dev/null

#if you want debugging from the very beginning
#touch /mnt/etc/do_debug

mkdir /mnt/to_install
cp /to_install/do_install* /mnt/to_install

cd /mnt
pivot_root . cdrom

chmod 744 /etc/init.d/*
chmod 744 /etc/install.d/*

exec chroot . sh <dev/console >dev/console 2>&1

mount -a
What about the "mount -a"? Before this script is called, the only things that are mounted are /proc, and /tmp and /var/log (both using a ram-disk). When the final "mount -a" is called, the /etc/fstab looks like:

PHP Code:
# file system   mount-point     type            options         dump    fsck
#                                                                       order
proc            /proc           proc            defaults        0       0

/dev/hda1       /               ext3            rw              0       1
/dev/hda2       swap            swap            sw              0       0
/dev/hda3       /home           ext3            rw              0       2

/dev/sda1       /mnt/usb        vfat            rw,noauto       0       0
/dev/hdb        /mnt/cdrom      iso9660         ro,noauto       0       0 
I apologize for the lengthy post, but I am stuck trying to figure out what is going on concerning the kernel panic. When I dealt with the 2.4.27 kernel, this script worked great. Ever since I changed to using 2.6.x versions, I have been getting the kernel panic. I am currently using 2.6.20.1 of the Linux kernel.

Last edited by dwhitney67; 09-29-2007 at 06:30 PM.
 
Old 10-01-2007, 09:43 PM   #5
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,610
Blog Entries: 4

Rep: Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905
I'm afraid that it's a bit impossible for me to associate the symptoms that you relate ... to the "code" block that follows it in your post.

I suggest that you (after you've reviewed the text of the preceding post and posted a corrected version...) do an on-line Google search of "pivot_root." In other words, try to understand what your computer is doing, as a way of identifying at what point it is doing [something] wrong.

And mind you, I make that suggestion not entirely 'flippantly.' This is not my obscure way of saying "RTFM!" Rather, it's a pointer for helping you to diagnose your problem.

We both know .. we both can plainly see .. that "the poor computer is smashing against the wall, utterly unaware of how stupid it is being." (The stupid silicon-brained git... )

We also both know that the sequence that your computer is going through ... well actually, smashing through with all of the grace of a bull in a china-shop ... is supposed to be "a well-enough-tested sequence that" some software developer, somewhere, saw fit to release it as a public distribution to the entire world. Therefore, the problem (whatever it is) must be particular to you, and so you are going to have to deduce what the problem is. (Unfortunately, there just isn't much that "any of us" can do to help you at this point ...)

But you will figure it out. And we, having "been there, done that" many times, will be anxious to know. (As will the next poor bloke .. you! yes you! hi! how's the kids?! .. who will stumble upon this very thread sometime in our future.)

Last edited by sundialsvcs; 10-01-2007 at 09:45 PM.
 
Old 10-01-2007, 11:01 PM   #6
dwhitney67
Senior Member
 
Registered: Jun 2006
Location: Maryland
Distribution: Kubuntu, Fedora, RHEL
Posts: 1,541

Rep: Reputation: 335Reputation: 335Reputation: 335Reputation: 335
I have determined that it is not the script, but instead something dealing with how I have configured the kernel or with busybox-1.0.1 (with which I am relying upon for an Ash shell capabilities).

Today I inserted an entry within my Grub configuration that takes me directly to an Ash shell after the kernel is loaded. When I immediately exit that shell, the kernel panic occurs. So I have learned that it is not the script I wrote about earlier.
 
Old 10-02-2007, 02:21 PM   #7
TheDirtyScreech
Member
 
Registered: Jul 2007
Distribution: Gentoo, LFS
Posts: 42

Rep: Reputation: 15
This thread seems to have been hijacked away from prakashburla. Okie is right in that ext3 must be compiled into the kernel itself, not as a loadable module (possibly could be a module if the module is put into the initrd/initramfs file). Ext3 support as a module is my initial idea of what's wrong with prakashburla's kernel panic.

The next would be that ext3 isn't compiled into the kernel at all (unlikely since it's usually enabled by default in most disto's .config files). It seems possible, but unlikely, that he may have used some walk-through to help him format his disks with ext3, correctly modify his /etc/fstab file, and simply not compile ext3 into the kernel at all. Or, maybe he followed the walk-through but wanted a different FS (reiserfs, for example). Again, probably not likely, but definitley not impossible.

prakashburla: One thing to note is that by the time you're getting to loading your disks, grub/lilo have done what they do, and changing their configs shouldn't help your situation. At that point, it would be the /etc/fstab file if anything was incorrect. Maybe you formatted the filesystems for reiserfs, but your /etc/fstab file specifies them as ext3 or something. Can you post what filesystem you wanted, your /etc/fstab file, and tell us what filesystems you actually have configured in your kernel (and if their modules or not)?

-TDS-
 
  


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
why kernel panics Niloy Linux - Software 3 08-16-2005 01:46 PM
more kernel panics... Legrow Fedora 0 04-18-2005 10:25 AM
2.6.1 and kernel panics hondaman Mandriva 6 02-07-2004 08:18 PM
Kernel 2.4.23 compile causes kernel panics on ATA RAID-1 (mirror) array Raptor Ramjet Slackware 3 12-18-2003 01:40 PM
Kernel panics!!! pagal Linux - General 12 01-26-2003 02:29 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 11:47 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
Open Source Consulting | Domain Registration