LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Password
Linux From Scratch This Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.

Notices


Reply
  Search this Thread
Old 12-02-2013, 04:01 AM   #1
lich000king
Member
 
Registered: Jun 2011
Posts: 56

Rep: Reputation: Disabled
LFS kernel panic/boot problem


Hi

After successfully building lfs stable 7.4 using jhalfs I run into problems when rebooting.
I get kernel panic - no init found.

When I try to boot manually using the GRUB command line, I can see the root folder structure and the kernel image is where it is supposed to be. However, /dev only contains console and null. sda1 is not there for some reason.

I have read a lot of threads describing similar problems, but I could not find a solution. It looks as if the kernel was missing a driver. But I did the kernel config using essentially default settings. A large number of drivers is compiled into the kernel (not as a module). In particular, ext4 is there. I really don't know what to look for...

Any ideas?

I did do chapter 8 manually, grub install went through ok...

Code:
# Begin /boot/grub/grub.cfg
set default=0
set timeout=5

insmod ext2
set root=(hd0,1)

menuentry "GNU/Linux, Linux 3.10.10-lfs-7.4" {
        linux   /boot/vmlinuz-3.10.10-lfs-7.4 root=/dev/sda1 ro
}
Code:
# /etc/fstab

/dev/sda1   /         ext4   defaults       0        0
proc        /proc     proc   defaults       0        0
sys         /sys      sys    defaults       0        0
devpts      /dev/pts  devpts gid=4,mode=620 0        0
tmpfs       /run      tmpfs  defaults       0        0
 
Old 12-02-2013, 08:17 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
I'm not sure this is a grub problem.

Have you double checked the /etc/inittab file for correctness and the presence of /sbin/init?
 
Old 12-02-2013, 08:50 AM   #3
lich000king
Member
 
Registered: Jun 2011
Posts: 56

Original Poster
Rep: Reputation: Disabled
Hi druuna

Thanks for your reply.
Hm, I installed mingetty and changed /etc/inittab accordingly (in order to get auto login).

However, now I have overwritten the file with the original from the book and reinstalld the lfs-bootscripts. It still doesn't work (same message).
What do you mean by /sbin/init, exactly? Because the book version does not contain this line:
http://www.linuxfromscratch.org/lfs/...r07/usage.html
 
Old 12-02-2013, 08:56 AM   #4
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
The init command itself is installed here: 6.59. Sysvinit-2.88dsf

Can you post the exact error message (or a screen-shot) with +/- 10 lines leading up to the error?
 
Old 12-02-2013, 09:03 AM   #5
lich000king
Member
 
Registered: Jun 2011
Posts: 56

Original Poster
Rep: Reputation: Disabled
I tried again, this time I reinstalled Sysvinit-2.88dsf, then the bootscripts. Still the same.
Here is the screenshot:
http://postimg.org/image/atxeznalb/
Unfortunately, that's all the console shows.
I'm on a virtual box right now, but the error also appears on an physical machine.
 
Old 12-02-2013, 09:17 AM   #6
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Looking at the output posted you can see that sda1 (device 8:1) can be mounted, grub seems to be doing its part.

That leaves the following:
- /sbin/init
- /etc/inittab
- /etc/rc.d/*

I would concentrate on the last 2.
- There's either a mistake in /etc/inittab.
- One (or more) files in /etc/rc.d is missing or incorrect.
 
Old 12-02-2013, 10:11 AM   #7
lich000king
Member
 
Registered: Jun 2011
Posts: 56

Original Poster
Rep: Reputation: Disabled
Hm...

/sbin/init is in place.
So are the contents of /etc/rc.d. I checked the files from appendix D, i.e. the files from the bootscripts, and they are all there.
/etc/inittab is a copy/paste from the book so it should be correct.

I really don't know what to look for.
I'm sure it's something very simple...
 
Old 12-02-2013, 10:36 AM   #8
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Quote:
Originally Posted by lich000king View Post
/sbin/init is in place.
Can I assume you actually checked this?

Quote:
So are the contents of /etc/rc.d. I checked the files from appendix D, i.e. the files from the bootscripts, and they are all there.
The scripts might be there, but are the correct script(s) called from /etc/inittab?

Quote:
/etc/inittab is a copy/paste from the book so it should be correct.
I've seen copy/pastes from the book go wrong. Depends on the book, but I do believe that copy/pasting from pdf books can go wrong. Do check the html version (book or on-line) and/or post it here.
 
Old 12-03-2013, 03:56 AM   #9
lich000king
Member
 
Registered: Jun 2011
Posts: 56

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by druuna View Post
Can I assume you actually checked this?
Code:
root:/# ls sbin/ |grep init
init
telinit

Quote:
The scripts might be there, but are the correct script(s) called from /etc/inittab?
I will look into this.

Quote:
I've seen copy/pastes from the book go wrong. Depends on the book, but I do believe that copy/pasting from pdf books can go wrong. Do check the html version (book or on-line) and/or post it here.
I always use the online html version of the book, see the link in my second post and the following:

Code:
root:/# cat etc/inittab 
# Begin /etc/inittab

id:3:initdefault:

si::sysinit:/etc/rc.d/init.d/rc S

l0:0:wait:/etc/rc.d/init.d/rc 0
l1:S1:wait:/etc/rc.d/init.d/rc 1
l2:2:wait:/etc/rc.d/init.d/rc 2
l3:3:wait:/etc/rc.d/init.d/rc 3
l4:4:wait:/etc/rc.d/init.d/rc 4
l5:5:wait:/etc/rc.d/init.d/rc 5
l6:6:wait:/etc/rc.d/init.d/rc 6

ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now

su:S016:once:/sbin/sulogin

1:2345:respawn:/sbin/agetty --noclear tty1 9600
2:2345:respawn:/sbin/agetty tty2 9600
3:2345:respawn:/sbin/agetty tty3 9600
4:2345:respawn:/sbin/agetty tty4 9600
5:2345:respawn:/sbin/agetty tty5 9600
6:2345:respawn:/sbin/agetty tty6 9600

# End /etc/inittab
The two are identical, i.e. no copy/paste error.
 
Old 12-03-2013, 07:24 AM   #10
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
The output shown looks correct.

BTW: You might be able to use SHIFT-PAGEUP in the console to see some more lines, which might tell us more.
 
Old 12-03-2013, 07:43 AM   #11
lich000king
Member
 
Registered: Jun 2011
Posts: 56

Original Poster
Rep: Reputation: Disabled
I'm on the physical machine now. Shift-Pageup does not work but I can see a little mor due to higher resolution. Right before the EXT4 message two error messages failing to mount ext2 and ext3 appear. Before this there is only a long list of drivers being loaded. No errors or warnings. Looks reasonable to me.

From looking at inittab and /etc/rc.d I can't find anything wrong. But maybe I don't know what to look for exactly.

I think the best thing for me to do is to rebuild the whole system, sticking to the book as closely as possible. Then try to reboot again and see if it works...
 
Old 12-04-2013, 04:25 AM   #12
lich000king
Member
 
Registered: Jun 2011
Posts: 56

Original Poster
Rep: Reputation: Disabled
Ok, I restarted where jhalfs finished, i.e. at the end of chapter 6. Then I sticked as closely to the book as possible. Now I get a different error message (this time from the virtual box, where shift+page up works):

http://postimg.org/image/fzc6j8asd/
http://postimg.org/image/u68kevm4b/

I will try this on a physical machine to see if it has something to do with virtualbox.
 
Old 12-04-2013, 04:52 AM   #13
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
I don't see any virtual box related errors.

The errors I do see indicate possible missing or wrong entries in /etc/fstab. It should look something like this (looks different then the one in your first post):
Code:
# Begin /etc/fstab

# file system  mount-point  type     options             dump  fsck
#                                                              order

/dev/sda1      /            ext4     defaults            1     1
/dev/<yyy>     swap         swap     pri=1               0     0
proc           /proc        proc     nosuid,noexec,nodev 0     0
sysfs          /sys         sysfs    nosuid,noexec,nodev 0     0
devpts         /dev/pts     devpts   gid=5,mode=620      0     0
tmpfs          /run         tmpfs    defaults            0     0
devtmpfs       /dev         devtmpfs mode=0755,nosuid    0     0

# End /etc/fstab
If you do not use swap, remove that line.

Also have a look at /etc/rc.d/init.d/mountvirtfs to determine what is done.
 
Old 12-06-2013, 05:49 AM   #14
lich000king
Member
 
Registered: Jun 2011
Posts: 56

Original Poster
Rep: Reputation: Disabled
Right! My /etc/fstab is bad.
The test system I created booted perfectly with the corrected file.

The other system still does not boot. The reason is the kernel config. It can't mount the root file system.
I suspect it misses some driver, but I have yet to find which. My system does not have any modules, but a lot of drivers compiled into the kernel. I don't know how I could have missed such an important part. But I will simply compare the config files to find out where the problem lies. The other system does boot with a defconfig kernel...
I will post back when I have the solution.

Thanks so far, druuna!
 
Old 12-06-2013, 06:13 AM   #15
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
You've talked about and been using different machines and different configurations.

To stay on the right track can you post the error(s) shown (as much as possible, like post #12) from the machine you are having problems with?

First thing that comes to mind without seeing any errors: This one needs to be selected
Device Drivers -> Generic Driver Options -> Maintain a devtmpfs filesystem to mount at /dev
 
  


Reply



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
Boot problems, LFS Kernel Panic BrandonJ Linux From Scratch 7 05-20-2010 12:37 PM
Can't boot LFS ( kernel panic - not syncing ) LFS 6.6 Lyle Linux From Scratch 14 05-15-2010 03:22 AM
LFS will not boot: kernel panic Bliepo Linux From Scratch 2 06-16-2009 03:30 PM
Unable to boot LFS... Kernel Panic - not syncing lfs_rocks Linux From Scratch 5 04-13-2008 02:37 AM
Kernel panic on first boot -- LFS 6.2 on i686 PC. creativename Linux From Scratch 3 06-16-2007 03:32 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch

All times are GMT -5. The time now is 05: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