Tux's lil' helper
Joined: 06 Dec 2002
|Posted: Tue Feb 03, 2004 4:42 pm Post subject: Som hints about "kernel panic: No init found."
|Ran into troubles today when installing a new machine. Grub installed without problems, i could chroot into the new system from a LiveCD without errors and so on. Everything was fine except when tried to boot the machine i ran into errors:
The kernel was found, also the Board, CPU and so on but when init tried to run i got an error:
"kernel panic: No init found. Try to add init= to the options"
Found a nice list of what could cause such an error, here it is:
I just spent a few days trying to get my RH8 Linux installation working
again. It was working VERY well and then suddenly would not reboot. The
error I was receiving was:
pivotroot: pivot_root(/sysroot, /sysroot/initrd) failed: 2
umount /initrd/proc failed: 2
kernel panic: No init found. Try passing init = option to kernel.
I spent a lot of time troubleshooting this problem without any success.
The cause of the problem was that my root partition did not have an initrd
directory present. That was it. /initrd must be present in the root
directory or this error will appear.
There are lots of Dejanews posts on the topic of "No init found".
Unfortunately, some of them contain misleading information.
I've seen and solved this error before. The first time I saw it, I was
building a Linux clone drive and I didn't have grub set up correctly
(Actually, I needed to label the boot partition as "/boot" or edit
grub.conf to match). Usually what this error message is telling us is
that grub can't find or run /sbin/init.
Here are some other things to look for:
a) check that the file systems are not corrupted. I usually run fsck on
them to be sure. I also run fdisk and check that the size and filesystem
type make sense.
b) check that /sbin/init is present.
c) check that the labels on the HD partitions are set correctly ie the
boot partition (usually /dev/hda1, but not always) needs to have a
label of "/boot", without the quotes. (Use e2label to set this up.) The root
partition needs to have a label of "/". Grub in particular is sensitive to
how this is set up because it refers to drives by their labels rather than
their hard coded position ie /dev/hda1.
d) check that grub is correctly installed ie. that grub-install has been
run and that commands have been run to set the root partition in grub and
that grub knows where the stage1, stage2 and grub.conf files are. (I wrote
a "Giving back how to" on cloning linux drives. All this info is there.)
Usually grub boot problems give different error messages, but not
necessarily. ANYTHING that will prevent the boot process from running
init will give the "No init found" error.
e) check that fstab has decent information in it for the drive mounting.
Furthermore, check that the drive definitions in fstab match the drive
defs in grub. Check out the miscellaneous section of info-grub for
details on how grub defines drives (hd0,0) versus how linux finds drives
f) check that the root drive has an initrd directory present.
Remember that ANYTHING that will prevent the boot process from running
init without error will give the "No init found" error. If a path is
wrong, a file is missing, a directory is missing or a file is corrupt
you will receive this error.
I hope this helps someone.
Checked my installation and found several errors. Initrd was missing (my fault) and in /etc/fstab i didn't change the settings for /dev/ROOT and /dev/BOOT.
After this, my system still refused to work, still the same problems. And according to the quoted text everything was ok.
The solution: I had a look at the kernel i tried to run and found a stupid error: To save memory i removed the support for a.out and misc binaries. At least i thougth because a.out was still in enabled in the kernel and ELF was marked as "Module". Not surprising that a system based on ELF binaries (including modprobe nad insmod) can't be booted when support for ELF-binaries is not compiled into the kernel.
Recompiling the kernel, this time with ELF in kernel solved the problem.
So, as mentioned above:
I hope this helps someone.