LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Gentoo
User Name
Password
Gentoo This forum is for the discussion of Gentoo Linux.

Notices

Reply
 
Search this Thread
Old 03-26-2010, 02:10 PM   #1
Pier
Member
 
Registered: Oct 2005
Location: Italy
Distribution: Gentoo
Posts: 83

Rep: Reputation: 17
Diskless: Kernel panic-not syncing: No init found. Try passing init= option to kernel


Hi all.
I am trying to boot a disk-less node which is getting the kernel and initrd from a master.
This is the final part with error message I get from the node when trying to boot it disk-less through PXE/tftp:

---------------------- snip -----------------------------
RAMDISK: 7dfff000 - 7ffff000
---------------------------------------------------------

which is 32M

Then:

----------------------- snip -----------------------------
[ 3.611823] Trying to unpack rootfs image as initramfs...
[ 3.676497] rootfs image is not initramfs (junk in compressed archive); looks like an initrd
[ 3.798428] Freeing initrd memory: 32768k freed
----------------------------------------------------------

--------------------- snip ------------------------------

[ 12.454077] Sending DHCP requests ., OK
[ 12.505131] IP-Config: Got DHCP answer from 192.168.100.2, my address is 192.168.100.21
[ 12.605130] sky2 eth1: disabling interface
[ 12.656557] IP-Config: Complete:
[ 12.693123] device=eth0, addr=192.168.100.21, mask=255.255.255.0, gw=192.168.100.2,
[ 12.789327] host=192.168.100.21, domain=mydomain.com, nis-domain=(none),
[ 12.874822] bootserver=192.168.100.2, rootserver=192.168.100.2, rootpath=
[ 12.964828] md: Skipping autodetection of RAID arrays. (raid=autodetect will force)
[ 13.056558] RAMDISK: ext2 filesystem found at block 0
[ 13.117064] RAMDISK: Loading 32768KiB [1 disk] into ram disk... done.
[ 17.861194] VFS: Mounted root (ext2 filesystem) on device 1:0.
[ 17.931053] Freeing unused kernel memory: 1336k freed
[ 17.991958] Write protecting the kernel read-only data: 6720k
[ 18.061293] Kernel panic - not syncing: No init found. Try passing init= option to kernel.
[ 18.161298] Pid: 1, comm: swapper Not tainted 2.6.31-gentoo-r6 #13
[ 18.235249] Call Trace:
[ 18.264477] [<ffffffff81486132>] panic+0xa0/0x151
[ 18.321790] [<ffffffff810092fb>] init_post+0x187/0x188
[ 18.384291] [<ffffffff81870cdf>] kernel_init+0x1bf/0x1ce
[ 18.448878] [<ffffffff8100cc2a>] child_rip+0xa/0x20
[ 18.508269] [<ffffffff81870b20>] ? kernel_init+0x0/0x1ce
[ 18.572855] [<ffffffff8100cc20>] ? child_rip+0x0/0x20
----------------------------------------------------------

This is the pxelinux.cfg file:

DEFAULT /bzImage
APPEND ip=dhcp raid=noautodetect initrd=rootfs root=/dev/ram rw ramdisk_size=32768 console=ttyS0,9600

I tried to put a simple binary "hello world" executable as init=a.out but no avail:

------------------ snip ---------------------------------
[ 12.953423] RAMDISK: ext2 filesystem found at block 0
[ 13.013927] RAMDISK: Loading 32768KiB [1 disk] into ram disk... done.
[ 17.768966] VFS: Mounted root (ext2 filesystem) on device 1:0.
[ 17.838766] Freeing unused kernel memory: 1336k freed
[ 17.899647] Write protecting the kernel read-only data: 6720k
[ 17.968947] Failed to execute a.out. Attempting defaults...
[ 18.036671] Kernel panic - not syncing: No init found. Try passing init= option to kernel.
[ 18.136698] Pid: 1, comm: swapper Not tainted 2.6.31-gentoo-r6 #13
[ 18.210641] Call Trace:
[ 18.239868] [<ffffffff81486132>] panic+0xa0/0x151
[ 18.297170] [<ffffffff810092fb>] init_post+0x187/0x188
[ 18.359676] [<ffffffff81870cdf>] kernel_init+0x1bf/0x1ce
[ 18.424258] [<ffffffff8100cc2a>] child_rip+0xa/0x20
[ 18.483646] [<ffffffff81870b20>] ? kernel_init+0x0/0x1ce
[ 18.548229] [<ffffffff8100cc20>] ? child_rip+0x0/0x20
---------------------------------------------------------

Any hint on how to investigate this would be appreciated.

Last edited by Pier; 03-27-2010 at 06:56 AM.
 
Old 03-27-2010, 05:40 AM   #2
Pier
Member
 
Registered: Oct 2005
Location: Italy
Distribution: Gentoo
Posts: 83

Original Poster
Rep: Reputation: 17
Just for history I keep up to date my struggle with disk-less node booting:

further investigation of boot message put my attention on this line:

[ 0.000000] RAMDISK: 7f717000 - 7ffff37d

which is x8e837d -> around 9120k

[ 3.617878] Trying to unpack rootfs image as initramfs...
[ 3.900495] Freeing initrd memory: 9120k freed

I think this is a point...

Parameters passed to kernel are:

DEFAULT /bzImage
APPEND ip=dhcp raid=noautodetect initrd=provainitrd.img root=/dev/ram0 rw rdinit=/sbin/init rw ramdisk_size=32768 console=ttyS0,9600

where:

mindthegap diskless # ls -alh provainitrd.img
-rw-r--r-- 1 root root 9.0M Mar 27 11:27 provainitrd.img

where:
cd loop1
find ./ | cpio -H newc -o |gzip -c9 >../provainitrd.img

produced provainitrd.img in loop1, the dir with the fs tree to be exported.

Node's kernel has:

CONFIG_BLK_DEV_RAM_SIZE=32768
CONFIG_CRAMFS=y

whereas fstab on node:
/dev/ram0 / ext2 noatime 0 1
mindthegap:/usr /usr nfs defaults 2 1
mindthegap:/opt /opt nfs sync,hard,intr,ro,nolock,rsize=8192,wsize=8192 0 1
mindthegap:/home /home nfs sync,hard,intr,rw,nolock,rsize=8192,wsize=8192 0 1
none /proc proc defaults 0 0
mindthegap:/var/log /var/log nfs nolock,hard,intr,rw 0 0


The error message now is:

[ 12.920873] Freeing unused kernel memory: 1336k freed
[ 12.981650] Write protecting the kernel read-only data: 6720k
[ 13.050867] Failed to execute /sbin/init
[ 13.097768] Kernel panic - not syncing: No init found. Try passing init= option to kernel.
[ 13.197707] Pid: 1, comm: swapper Not tainted 2.6.31-gentoo-r6 #14
[ 13.271651] Call Trace:
[ 13.300879] [<ffffffff81486e52>] panic+0xa0/0x151
[ 13.358182] [<ffffffff810092fb>] init_post+0x187/0x188
[ 13.420699] [<ffffffff81870cdf>] kernel_init+0x1bf/0x1ce
[ 13.485273] [<ffffffff8100cc2a>] child_rip+0xa/0x20
[ 13.544658] [<ffffffff81870b20>] ? kernel_init+0x0/0x1ce
[ 13.609241] [<ffffffff8100cc20>] ? child_rip+0x0/0x20

Last edited by Pier; 03-27-2010 at 05:53 AM.
 
Old 03-27-2010, 02:12 PM   #3
Pier
Member
 
Registered: Oct 2005
Location: Italy
Distribution: Gentoo
Posts: 83

Original Poster
Rep: Reputation: 17
Well for those who might be interested:
making the ramdisk as described in:

http://tiexpressdsp.com/index.php/Initrd

pushed the cart a little bit ahead.

I left the a.out ("Hello world" statically compiled test program as a fake init script), then:
---------------------------------------------------
dd if=/dev/zero of=/dev/ram0 bs=1k count=32768
mke2fs -vm0 /dev/ram0 32768
tune2fs -c 0 /dev/ram0
dd if=/dev/ram0 bs=1k count=32768 > ramdisk
----------------------------------------------------

and now the messages changed like this:

---------------- snip ----------------------------
[ 3.610289] Trying to unpack rootfs image as initramfs...
[ 3.674964] rootfs image is not initramfs (junk in compressed archive); looks like an initrd
[ 3.796907] Freeing initrd memory: 32768k freed
------------------------ snip ----------------------
[ 12.937134] RAMDISK: ext2 filesystem found at block 0
[ 12.997637] RAMDISK: Loading 32768KiB [1 disk] into ram disk... done.
[ 17.761085] VFS: Mounted root (ext2 filesystem) on device 1:0.
[ 17.830894] Freeing unused kernel memory: 1336k freed
[ 17.891797] Write protecting the kernel read-only data: 6720k
Hello World
[ 17.977042] a.out used greatest stack depth: 4448 bytes left
[ 18.044817] Kernel panic - not syncing: Attempted to kill init!
[ 18.115630] Pid: 1, comm: a.out Not tainted 2.6.31-gentoo-r6 #18
[ 18.187500] Call Trace:
[ 18.216727] [<ffffffff81486e52>] panic+0xa0/0x151
[ 18.274032] [<ffffffff8108ca8b>] ? call_rcu+0x10/0x12
[ 18.335502] [<ffffffff810479e6>] ? put_files_struct+0xb5/0xc2
[ 18.405289] [<ffffffff8104f51d>] ? exit_ptrace+0x33/0x131
[ 18.470914] [<ffffffff81049106>] do_exit+0x79/0x736
[ 18.530299] [<ffffffff8105e67f>] ? up_read+0x9/0xb
[ 18.588647] [<ffffffff8104983c>] do_group_exit+0x79/0xa6
[ 18.653232] [<ffffffff8104987b>] sys_exit_group+0x12/0x16
[ 18.718864] [<ffffffff8100bb42>] system_call_fastpath+0x16/0x1b
-----------------------------------------------------------------------

With a compressed ramdisk:

dd if=/dev/ram0 bs=1k count=32768 | gzip -v9 > ramdisk.gz
----------------------------------------------------
[ 3.619726] Trying to unpack rootfs image as initramfs...
[ 3.684571] rootfs image is not initramfs (no cpio magic); looks like an initrd
[ 3.778355] Freeing initrd memory: 9520k freed
----------------------------------------------------
[ 12.858307] RAMDISK: gzip image found at block 0
[ 13.133602] VFS: Mounted root (ext2 filesystem) on device 1:0.
[ 13.203456] Freeing unused kernel memory: 1336k freed
[ 13.264353] Write protecting the kernel read-only data: 6720k
[ 13.333709] Kernel panic - not syncing: No init found. Try passing init= option to kernel.
[ 13.433752] Pid: 1, comm: swapper Not tainted 2.6.31-gentoo-r6 #18
[ 13.507713] Call Trace:
[ 13.536943] [<ffffffff81486e52>] panic+0xa0/0x151
[ 13.594254] [<ffffffff810092fb>] init_post+0x187/0x188
[ 13.656770] [<ffffffff81870cdf>] kernel_init+0x1bf/0x1ce
[ 13.721367] [<ffffffff8100cc2a>] child_rip+0xa/0x20
[ 13.780769] [<ffffffff81870b20>] ? kernel_init+0x0/0x1ce
[ 13.845364] [<ffffffff8100cc20>] ? child_rip+0x0/0x20
 
Old 03-27-2010, 05:49 PM   #4
AlvinTheNerd
LQ Newbie
 
Registered: Mar 2010
Posts: 1

Rep: Reputation: 1
I am creating a Opensuse based diskless cluster and had very similar results as you. VFS showed the system mounting, I had checked and rechecked the kernel, init was working, but somehow the kernel was not syncing. After digging through lots and lots of forums and my own notes (I had done it before, which made this problem all the more frustrating), I found the problem:

my libraries weren't all there. Most howto's are based on 32 bit systems and ask to cp over /lib to the node's root directory. However, in a 64 bit system, you need /lib /lib32, and /lib64. Once I did that, everything worked great.

Hope that helps
 
Old 03-28-2010, 05:16 AM   #5
Pier
Member
 
Registered: Oct 2005
Location: Italy
Distribution: Gentoo
Posts: 83

Original Poster
Rep: Reputation: 17
AlvinTheNerd,
thanks a lot, copying /lib32 did the trick.
Well how about that! Init needs 32bit libraries so as to work.
Thanks again

Last edited by Pier; 03-28-2010 at 06:51 AM.
 
Old 04-09-2010, 09:33 PM   #6
cyberswim
LQ Newbie
 
Registered: Apr 2010
Posts: 1

Rep: Reputation: 0
Smile

AlvinTheNerd,

I had to copy /lib64 for 64bit linux PXE. Thank you so much.
 
Old 10-10-2011, 06:17 AM   #7
ramuuu
LQ Newbie
 
Registered: Oct 2011
Posts: 1

Rep: Reputation: Disabled
Hi Alvin/Pier,

I too got the same error while booting a ARM5 core with Debian squeeze. But, it got resolved when i recreated my filesystem directly on a LinuxPC instead of using SSH/Telnet clients on a WinPC. But, still dont know what the problem was and how it got resolved...Any ideas?

I think when we copy the filesystem tar.gz file and extract it, the file characteristics changes..??? or Is it?
 
  


Reply

Tags
cluster, diskless, gentoo


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
Kernel panic-not syncing:No init found. Try passing init=option to kernel cucolin@ Ubuntu 5 12-26-2008 06:44 AM
Kernel panic - not syncing: No init found. Try passing init= option to kernel. john_schimandle Linux - Embedded & Single-board computer 3 10-10-2008 09:09 AM
Kernel panic - not syncing: No init found. Try passing init= option to kernel. john_schimandle Linux - Newbie 4 10-09-2008 02:40 AM
Kernel panic - not syncing: No init found. Try passing init= option to kernel ranjithmrk Linux - Newbie 4 08-22-2008 02:33 PM


All times are GMT -5. The time now is 07:32 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration