Linux - KernelThis forum is for all discussion relating to the Linux kernel.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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...
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.)
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
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.
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 supposedtobe "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.
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.
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)?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.