Kernel Panic: No init found. ...
Hi,
I've made a boot disk with the kernel in one floppy and root fs in the other. The kernel boots and asks for thr Root filesystem. On iserting the root fs floppy, I get the message: RAMDISK: Compressed image found a block 0 For about 30-35 seconds it continues to read the floppy. Then it flashes the message: Kernel Panic: No init found. Try passing init= option to kernel. Then my keyboard also stops responding except for the Num lock and Caps Lock keys. Is it something wong with the libraries. My 'ldd init' gives libc.so.6 => /lib/i686/libc.so.6 ld-linux.so.2 => /lib/ld-linux.so.2 So, I've copied my loader to /lib, but the library and its link to /lib/i686 directory. It's too big to be copied twice. So, I didn't copy it in /lib. I also made a soft link from /lib/lic.so.6 to the library in /lib/i686 in the hope of rectifying the error. But it didn't help. I'm using RH 7.3. Any ideas? |
what's in /etc/inittab
you need to strip the libs so they will fit you need to have an ld.so.conf file in /etc and run ldconfig to create the cache file |
My inittab file is:
id:2:initdefault: # System initialization. si::sysinit:/etc/rc.d/rc.sysinit l0:0:wait:/etc/rc.d/rc 0 l1:1:wait:/etc/rc.d/rc 1 l2:2:wait:/etc/rc.d/rc 2 l3:3:wait:/etc/rc.d/rc 3 l4:4:wait:/etc/rc.d/rc 4 l5:5:wait:/etc/rc.d/rc 5 l6:6:wait:/etc/rc.d/rc 6 # Things to run in every runlevel. ud::once:/sbin/update # Run gettys in standard runlevels 1:2345:respawn:/sbin/mingetty 9600 tty1 2:2345:respawn:/sbin/mingetty 9600 tty2 3:2345:respawn:/sbin/mingetty 9600 tty3 4:2345:respawn:/sbin/mingetty 9600 tty4 5:2345:respawn:/sbin/mingetty 9600 tty5 6:2345:respawn:/sbin/mingetty 9600 tty6 Though I haven't seen the update file included anywhere else, when I did 'man update', it said that this is the file that is executed every time by the system irrespective of the runlevel. So, I didn't delete it from inittab. I had done objcopy --strip-debug for all the libraries, and --strip-all for all the binaries. I had also done ldconfig. I think it shoukd be some error concerned with /etc/rc.d directory files. I might have not deleted the paths of some files properly, or something like that, because I don't know how to trim those files, all the rc.sysinit, rc, and all other files. I have included the libraries I think. |
I don't know how that happened.
It has substituted a string of a ':' and an 'o' by some smiley. And i'm not writing the exact line again otherwise it will again substite it with the smiley. Just replace the smiley with one clolon, and one o. So, the string becomes: ud (then 2 colons) (then the word 'once) (then a colon) (then/sbin/update) |
you don't need all that for a root floppy
I would trim it way down # /etc/inittab Davix Root Boot id:3:initdefault: si::sysinit:/etc/rc.d/rc.sysinit 1:2345:respawn:/bin/agetty tty1 9600 2:2345:respawn:/bin/agetty tty2 9600 3:2345:respawn:/bin/agetty tty3 9600 4:2345:respawn:/bin/agetty tty4 9600 5:2345:respawn:/bin/agetty tty5 9600 6:2345:respawn:/bin/agetty tty6 9600 |
[root@Firedragon root]# cat etc/rc.d/rc.sysinit
#!/bin/sh # /etc/rc.d/rc.sysinit Davix Root Boot /bin/syslogd /bin/klogd /bin/mount -av /bin/hostname Davix /etc/rc.d/rc.local |
[root@Firedragon etc]# cat fstab
# /etc/fstab Davix Root Boot #filesystem mount-point fs-type options dump fsck-order /dev/ram0 / ext2 defaults 0 0 /proc /proc proc defaults 0 0 |
No change in the result.
What files do I have to add in support of the /sbin/syslogd and /sbin/klogd? (On my system, it's /sbin and not /bin for these 2 files). Don't we need the script of rc.sysinit? What files do you have in /etc/rc.d/init.d? I've deleted almost all. It has all have script files, and they were either manipulating or using some files of /etc that I hadn't added, so I deleted those script files from init.d. I've also made changes to my lilo.conf stored on the hard disk so that I can test my kernel and FS from there also. When I boot from floppy, after giving kernel panic it doesn't respond to my alr+ctrl+del. But when I boot the same kernel and fs from the hard disk, it does give the same kernel panic, but when I press alt+ctrl+del it gives the message: <6>keyboard: unknown scancode e0 7a It's all boggled up. The main problem is either with /etc or /lib. What to do? |
Re: Kernel Panic: No init found. ...
Quote:
call me a simpilton (no, don't really), but it sounds like you didn't actually write the image to the floppy, but just copied the image straight to the disk. |
I posted my rc.sysinit above
you don't need the logging daemons if you don't want them All you should need is /etc/inittab which points to the init script which mounts proc and the rootfs this tells you everything you need to know http://www.tldp.org/HOWTO/Bootdisk-HOWTO/ |
drwxr-xr-x 2 root root 2048 Sep 17 15:02 bin
drwxr-xr-x 3 root root 16384 Aug 10 07:30 dev drwxr-xr-x 3 root root 1024 Sep 17 22:56 etc drwxr-xr-x 2 root root 1024 Aug 10 07:30 lib drwxr-xr-x 2 root root 1024 Aug 10 07:30 proc lrwxrwxrwx 1 root root 1 Aug 10 07:30 root -> . lrwxrwxrwx 1 root root 3 Aug 10 07:30 sbin -> bin |
[david@www dvx]$ ls -l etc
total 15 -rw-r--r-- 1 root root 91 Sep 17 15:05 filesystems -rw-r--r-- 1 root root 151 Sep 17 15:05 fstab -rw-r--r-- 1 root root 125 Sep 17 15:05 group -rw-r--r-- 1 root root 332 Sep 17 15:05 inittab -rw-r--r-- 1 root root 1097 Sep 17 22:56 ld.so.cache -rw-r--r-- 1 root root 0 Sep 17 22:56 ld.so.conf -rw-r--r-- 1 root root 0 Sep 17 22:55 login.defs lrwxrwxrwx 1 root root 14 Sep 17 15:05 mtab -> ../proc/mounts -rw-r--r-- 1 root root 198 Sep 17 15:05 nsswitch.conf -rw-r--r-- 1 root root 31 Sep 17 15:05 passwd -rw------- 1 root root 31 Sep 17 15:05 passwd- lrwxrwxrwx 1 root root 2 Sep 17 15:05 rc.d -> ./ -rwxr-xr-x 1 root root 92 Sep 17 15:05 rc.local -rwxr-xr-x 1 root root 202 Sep 17 15:05 rc.sysinit -r-------- 1 root root 38 Sep 17 15:05 shadow -rw------- 1 root root 38 Sep 17 15:05 shadow- drwxr-xr-x 2 root root 1024 Sep 17 15:05 sysconfig -rw-r--r-- 1 root root 311 Sep 17 15:05 syslog.conf |
[david@www dvx]$ ls -l etc/sysconfig
total 2 -rw-r--r-- 1 root root 156 Sep 17 15:05 ifcfg-lo -rw-r--r-- 1 root root 81 Sep 17 15:05 network lrwxrwxrwx 1 root root 2 Sep 17 15:05 network-scripts -> ./ |
[david@www dvx]$ ls -l lib
total 1943 -rwxr-xr-x 1 root root 97640 Aug 10 07:30 ld-2.2.5.so lrwxrwxrwx 1 root root 11 Aug 10 07:30 ld-linux.so.2 -> ld-2.2.5.so -rwxr-xr-x 1 root root 1395576 Aug 10 07:30 libc-2.2.5.so lrwxrwxrwx 1 root root 17 Aug 10 07:30 libcom_err.so.2 -> libcom_err.so.2.0 -rwxr-xr-x 1 root root 8228 Aug 10 07:30 libcom_err.so.2.0 -rwxr-xr-x 1 root root 23680 Aug 10 07:30 libcrypt-2.2.5.so lrwxrwxrwx 1 root root 17 Aug 10 07:30 libcrypt.so.1 -> libcrypt-2.2.5.so lrwxrwxrwx 1 root root 13 Aug 10 07:30 libc.so.6 -> libc-2.2.5.so lrwxrwxrwx 1 root root 13 Aug 10 07:30 libe2p.so.2 -> libe2p.so.2.3 -rwxr-xr-x 1 root root 18549 Aug 10 07:30 libe2p.so.2.3 lrwxrwxrwx 1 root root 16 Aug 10 07:30 libext2fs.so.2 -> libext2fs.so.2.4 -rwxr-xr-x 1 root root 99718 Aug 10 07:30 libext2fs.so.2.4 lrwxrwxrwx 1 root root 16 Aug 10 07:30 libmisc.so -> libmisc.so.0.0.0 lrwxrwxrwx 1 root root 16 Aug 10 07:30 libmisc.so.0 -> libmisc.so.0.0.0 -rwxr-xr-x 1 root root 72967 Aug 10 07:30 libmisc.so.0.0.0 -rwxr-xr-x 1 root root 42190 Aug 10 07:30 libnss_files-2.2.5.so lrwxrwxrwx 1 root root 21 Aug 10 07:30 libnss_files.so.1 -> libnss_files-2.2.5.so lrwxrwxrwx 1 root root 21 Aug 10 07:30 libnss_files.so.2 -> libnss_files-2.2.5.so -rwxr-xr-x 1 root root 103896 Aug 10 07:30 libpthread-0.9.so lrwxrwxrwx 1 root root 17 Aug 10 07:30 libpthread.so.0 -> libpthread-0.9.so -rwxr-xr-x 1 root root 34725 Aug 10 07:30 librt-2.2.5.so lrwxrwxrwx 1 root root 14 Aug 10 07:30 librt.so.1 -> librt-2.2.5.so lrwxrwxrwx 1 root root 18 Aug 10 07:30 libshadow.so -> libshadow.so.0.0.0 lrwxrwxrwx 1 root root 18 Aug 10 07:30 libshadow.so.0 -> libshadow.so.0.0.0 -rwxr-xr-x 1 root root 53371 Aug 10 07:30 libshadow.so.0.0.0 lrwxrwxrwx 1 root root 14 Aug 10 07:30 libuuid.so.1 -> libuuid.so.1.2 -rwxr-xr-x 1 root root 14175 Aug 10 07:30 libuuid.so.1.2 |
[david@www dvx]$ ls bin
[ dmesg id mkfs.ext3 reboot tr agetty dos2unix ifconfig mkfs.jfs reset traceroute ash du init mkfs.minix rm true basename dumpkmap kill mkfs.msdos rmdir tty bsh echo killall mkfs.reiserfs route umount busybox ed klogd mkfs.vfat rpm2cpio uname cat env ldd mknod sed uniq chgrp expr linuxrc mkswap sh unix2dos chmod false ln mktemp sleep uptime chown fbset loadacm modprobe sort uudecode chroot fdflush loadfont more stty uuencode chvt fdformat loadkmap mount swapoff wc clear fdisk logger msh swapon wget cmp find login mv sync which cp free ls nc syslogd whoami cpio freeramdisk lsmod nslookup tail xargs cut grep makedevs pidof tar yes date gunzip md5sum ping tee zcat dc gzip mkdir pivot_root telinit dd halt mke2fs poweroff telnet deallocvt head mkfs ps test df hostid mkfs.bfs pwd tftp dirname hostname mkfs.ext2 readlink touch |
[david@www etc]$ cat rc.sysinit
#!/bin/sh # /etc/rc.sysinit Davix Root Boot /bin/syslogd /bin/klogd /bin/mount -av /bin/mkdir /tmp /var /var/log /var/run /bin/touch /var/log/wtmp /var/run/utmp /bin/hostname Davix /etc/rc.local |
[david@www etc]$ cat rc.local
#/!bin/sh # etc/rc.local Davix Root Boot touch /etc/issue echo Davix Root Boot > /etc/issue |
If you want to save lots of room just forget the login stuff and start it in single user mode
then you can eliminate a lot of files |
Once it's booted you can add other stuff from a mounted floppy
I would do this mke2fs /dev/ram1 mke2fs /dev/ram2 mkdir /usr /usr/bin /mnt /mnt/floppy mount /dev/fd0 /mnt/floppy mount /dev/ram1 /usr mount /dev/ram2 /usr/bin cp -a /mnt/floppy/* /usr/bin/ PATH= $PATH:/usr/bin and so on |
a little confusion
You wrote:
you don't need the loging daemons if you don't want them All you should need is /etc/inittab which points to the init script which mounts proc and the rootfs 1)Does this line mean that I can make a link named inittab pointing to the init script? 2)What is the 'init script'. The init binary executable (I don't think so), or rc/sysinit, or something else? 3)'Point to roofs' !!! I thought I ws building the rootfs. What does pointing mean here? inittab: line 1: #/etc/inittab Davix Root Boot : There is no such line in my inittab (even if I ignore the Davix) rc.sysinit: line 2: #/etc/rc.d/rc.sysinit Davix Root Boot : Same problem. I don't know what it means. rc.sysinit: line 6: #/bin/hostname Davix : Do I replace Davix by 'Kangaroo", or something else, or leave this line comletely? rc.local: #/etc/inittab Davix Root Boot : What's this. Again No such line on my system. I'm was also reading this tldp site. But it didn't tell how to prune /etc files. I'll try it with the other files you've sent. I'm using dd to copy the root fs to the floppy. adi |
The syslogd and klogd are for system errors and such that will go where you tell them to go in /etc/syslog.conf
not using it won't stop you from booting what you need to do is mount -av so that /etc/fstab gets read and proc gets mounted and whatever you have there, like ram disks and such lines starting with # are comments and can be ignored unless they are shell scripts which should have #!/bin/sh on the first line I saw a document somewhere, most likely in the howto I linked to that stated to just start init in the inittab script I am using login so I have not tried it What I mean is not using all the gettys and everything else getty runs login |
Could i send you my attached rootfs to your some e-mail address. My directory has become too ju,bled up for me to solve.
And I couldn't understand your root->. link. Why's that needed? I'm using Red Hat 7.3 adi |
yea you can send it through the forum
root is roots home folder instead of making it a folder I made it / could do the same thing in /etc/passwd but I did not get around to it yet |
# echo $HOME /root
cd ~ pwd / |
I got the file
the file permissions are not set right on the libs they need to be executable also you will not be able to get in without /bin/login when you are using mingetty |
Almost done I think
Hi,
I made the changes you told me. I made the libraries executable, and I also deleted the invocations to syslogd because they were just messing up rather than helping me, and I changed the hostname from Kangaroo to 'yogesh' which is the actual hostname of this computer. Then I corrected some tit-bit of errors. Now after mounting the filesystems I get these messages: INIT: Entering runlevel: 2 INIT: Id "1" respawing too fast: disabled for 5 minutes. INIT: Id "2" respawing too fast: disabled for 5 minutes. INIT: Id "3" respawing too fast: disabled for 5 minutes. INIT: Id "4" respawing too fast: disabled for 5 minutes. INIT: Id "5" respawing too fast: disabled for 5 minutes. INIT: Id "6" respawing too fast: disabled for 5 minutes. INIT: no more processes left in this runlevel I checked for the login and mingetty executables and their dependent libraries. All seem to be present. I was thinking of mailing you the latest rootfs.gz, but I didn't note down your e-mail address, and now i see it's gone. Well, I think you've understood the problem anyway. And you can mail me back if you think there is a need. :-) Thanks. |
I will email you
|
Your problem is still with mingetty
I put /bin/bash in the place of /sbin/mingetty and the system boots this is not very useful though because you cannot have multi terminals that way and no login, similar to single user mode It would take a lot of changing and rebooting to come up with the exact fix, but I will say this much... I believe mingetty uses other program files besides login to operate, I would say that at least it needs chmod and chown, and there may be other required files in your /bin folder that you do not have. you may be able to setup syslog to output to the terminal and figure it out like that but I would not count on it telling you anything other than init complaining about respawning too fast I would go ahead and add as many of the common files in the /bin folder as I could and try it. Also you may need more /dev/files I think /dev/initctl will be required if you want to be able to change runlevels others may be needed depending on your kernel, but like I say it boots by replacing mingetty with bash so that's your main problem now. |
another thing you could do is look at the source code for mingetty and see what it uses, maybe even rebuild it and take out calls to other programs like chmod and chown as it is not really necessary to change it unless you are going to have users other than root
also I noticed that some files are not owned by root:root but some are root:tape and some other stuff, I did not compare that to your /etc/group file but I would just make them chown root:root if that's going to be the only user of the system. |
you will need some tools on there like cat and ls
ifconfig for networking mkfs to make some more ram disks and mount them an editor would be very usefull vi is too big, but ed is small and way better than nothing |
problem with linuxquestions.com
Hi sir,
I would like to tell you that I no more get alerts from linuxquestions.com that some messages have been poeted to your reply. I just opened this thread through previous messages I had recieved, adn found that you had posted many replies, but I wasn't notified. So, I thought it's important to bring this problem to notice. I'll check your previous replies just now, after mailing this one. Thanks. |
Hi Sir,
I tried what you said but it didn't turn out. What do you mean by 'putting /bin/bash in place of /sbin/mingetty' ? What I did was that I deleted mingettty, and modified the lines '1:234:respawn:/sbin/mingettty 9600 tty1' to '1:234:respawn:/bin/bash 9600 tty1'. But on booting it gave me these errors in addition to the respawing errors:- tty1: tty1: No such file or directory tty2: tty2: No such file or directory ............. ............. tty6: tty6: No such file or directory And I had already copied /bin/bash. What do you want to replace in the above sentence, I can't undestand. |
If you change it to
1:234:respawn:/bin/bash it will boot mingetty is not running because of some dependencies that are not there |
>I've made a boot disk with the kernel in one floppy and root fs >in the other. The kernel boots and asks for thr Root filesystem.
>On iserting the root fs floppy, I get the message: >RAMDISK: Compressed image found a block 0 >For about 30-35 seconds it continues to read the floppy. Then it >flashes the message: >Kernel Panic: No init found. Try passing init= option to kernel. After that the Caps and numlock key's are flashing ? When the root-filesystem is extracted and loaded from the second disk the kernel needs the folowing files to be in the /dev directory of your root-filesystem : fd0,ram0 and console note: they also need to be in the /dev directory on the first disk ! |
this is kind of old
it also helps when you have /sbin/init and login on it too |
All times are GMT -5. The time now is 08:13 PM. |