LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware - Installation (http://www.linuxquestions.org/questions/slackware-installation-40/)
-   -   Slackware Dual Boot: Kernel Panic (http://www.linuxquestions.org/questions/slackware-installation-40/slackware-dual-boot-kernel-panic-505129/)

trashbird1240 11-26-2006 11:07 PM

SOLVED! Slackware Dual Boot: Kernel Panic
 
Dear Forum,

I've just installed Slackware 11.0 on a second partition of my main
SATA drive (/dev/sda7) in the interest of setting up a dual boot with
PCLinuxOS. I'm getting


"Kernel panic -- not syncing -- no init found..."

Here's my MBR lilo.conf:

Code:

# File generated by DrakX/drakboot
# WARNING: do not forget to run lilo after modifying this file

default="linux"
boot=/dev/sda
map=/boot/map
menu-scheme=wb:bw:wb:bw
prompt
nowarn
timeout=100
message=/boot/message
image=/boot/vmlinuz
        label="linux"
        root=/dev/sda1
        initrd=/boot/initrd.img
        append="acpi=ht splash=verbose"
        vga=788
image=/boot/vmlinuz
        label="linux-nonfb"
        root=/dev/sda1
        initrd=/boot/initrd.img
        append="acpi=ht splash=verbose"
image=/boot/vmlinuz
        label="failsafe"
        root=/dev/sda1
        initrd=/boot/initrd.img
        append="failsafe"
image=/boot/vmlinuz
        label="slackware"
        root=/dev/sda7
        initrd=/boot/initrd.img

Here's the lilo.conf from the Slackware install I just did, installed to the root partition of the Slackware install:

Code:

# LILO configuration file
# generated by 'liloconfig'
#
# Start LILO global section
boot = /dev/sda7
#compact        # faster, but won't work on all systems.
prompt
timeout = 300
# VESA framebuffer console @ 1024x768x256
vga = 773
[VESA stuff cut out]
# End LILO global section
# Linux bootable partition config begins
image = /boot/vmlinuz
  root = /dev/sda7
  label = slackware
  read-only # Non-UMSDOS filesystems should be mounted read-only for checking
# Linux bootable partition config ends

How should I actually set this up? Do I need to tag /dev/sda7 as bootable in fdisk?

Thanks, I appreciate any help,
Joel

Bruce Hill 11-27-2006 01:53 AM

Linux does not require a partition to be tagged bootable -- only Windows needs that.

I don't know what "File generated by DrakX/drakboot" is -- sounds like something from Mandrake to me.

If your / (root) Slackware partition is /dev/sda7, that part is correct; but the Slackware way of setting up an initial ramdisk image is not "initrd=/boot/initrd.img". From the Slackware instructions:
Code:

mingdao@silas:~$ cat /boot/README.initrd

Slackware initrd mini HOWTO
by Patrick Volkerding, volkerdi@slackware.com
Sat Sep  3 22:20:13 PDT 2005

This document describes how to create and install an initrd, which may be
required to use the 2.6 kernel.  Also see "man mkinitrd".

1.  What is an initrd?
2.  Why to I need an initrd?
3.  How do I build the initrd?
4.  Now that I've built an initrd, how do I use it?


1.  What is an initrd?

Initrd stands for "initial ramdisk".  An initial ramdisk is a very small
Linux filesystem that is loaded into RAM and mounted as the kernel boots,
and before the main root filesystem is mounted.

2.  Why do I need an initrd?

The usual reason to use an initrd is because you need to load kernel
modules before mounting the root partition.  Usually these modules are
required to support the filesystem used by the root partition (ext3,
reiserfs, xfs), or perhaps the controller that the hard drive is attached
to (SCSI, RAID, etc).  Essentially, there are so many different options
available in modern Linux kernels that it isn't practical to try to ship
many different kernels to try to cover everyone's needs.  It's a lot more
flexible to ship a generic kernel and a set of kernel modules for it.  The
generic 2.6 kernel in Slackware supports the ext2 filesystem (which is
used by the initrd), and also supports most IDE controllers (much like the
old bare.i kernel).  So, if you have an IDE based system that uses the
ext2 filesystem, then you will not need to use an initrd to boot.
Otherwise, read on.

3.  How do I build the initrd?

The easiest way to make the initrd is to use the mkinitrd script included
in Slackware's mkinitrd package.  We'll walk through the process of
upgrading to the 2.6.13 Linux kernel using the packages found in
Slackware's testing/packages/linux-2.6.13/ directory.

First, make sure the kernel, kernel modules, and mkinitrd package are
installed (the current version numbers might be a little different, so
this is just an example):

  installpkg kernel-generic-2.6.13-i486-1.tgz
  installpkg kernel-modules-2.6.13-i486-1.tgz
  installpkg mkinitrd-1.0.1-i486-1.tgz

Change into the /boot directory:

  cd /boot

Now you'll want to run "mkinitrd".  I'm using reiserfs for my root
filesystem, and since it's an IDE system the reiserfs module will be
the only one I need to load:

  mkinitrd -c -k 2.6.13 -m reiserfs

This should do two things.  First, it will create a directory
/boot/initrd-tree containing the initrd's filesystem.  Then it will
create an initrd (/boot/initrd.gz) from this tree.  If you wanted to,
you could make some additional changes in /boot/initrd-tree/ and
then run mkinitrd again without options to rebuild the image.  That's
optional, though, and only advanced users will need to think about that.

Here's another example:  Build an initrd image using Linux 2.6.13
kernel modules for a system with an ext3 root partition on /dev/hdb3.
Note that you need both the jbd and ext3 modules to use ext3:

  mkinitrd -c -k 2.6.13 -m jbd:ext3 -f ext3 -r /dev/hdb3


4.  Now that I've built an initrd, how do I use it?

Now that you've got an initrd (/boot/initrd.gz), you'll want to load
it along with the kernel at boot time.  If you use LILO for your boot
loader you'll need to edit /etc/lilo.conf and add a line to load the
initrd.  Here's an example section of lilo.conf showing how this is
done:

# Linux bootable partition config begins
image = /boot/vmlinuz-generic-2.6.13
  initrd = /boot/initrd.gz
  root = /dev/hda6
  label = Lnx2613
  read-only
# Linux bootable partition config ends

The initrd is loaded by the "initrd = /boot/initrd.gz" line.
Just add the line right below the line for the kernel image you use.
Save the file, and then run LILO again ('lilo' at the command line).
You'll need to run lilo every time you edit lilo.conf or rebuild the
initrd.

Other bootloaders such as syslinux also support the use of an initrd.
See the documentation for those programs for details on using an
initrd with them.


---------

Have fun!

You can install LiLO to the MBR and boot both distros. No need to use the root partition. Here is an example of a dual boot /etc/lilo.conf for your viewing pleasure:
Code:

mingdao@silas:~$ cat /etc/lilo.conf
# LILO configuration file
# generated by 'liloconfig'
#
# Start LILO global section
append="panic=15"
boot = /dev/sda
compact        # faster, but won't work on all systems.
prompt
timeout = 50
# VESA framebuffer console @ 1024x768x256
vga = 773
# ramdisk = 0    # paranoia setting
# End LILO global section
# Linux bootable partition config begins
image = /boot/vmlinuz-2.6.18.3
  root = /dev/sda6
  label = Slack-2.6.18.3
  read-only
# Linux bootable partition config ends
# Windows bootable partition config begins
other = /dev/sda1
  label = Windoze
  table = /dev/sda
# Windows bootable partition config ends

If you don't understand, then use <Linux> Google as this is a very old issue.

I think if you setup your initrd image properly, you can boot. But if you installed the default kernel you shouldn't need one. To get back into your Slackware distro boot with Slackware CD1 and at the prompt type:
sata.i root=/dev/sda7 noinitrd ro

Once you're in, fix that initrd and install LiLO to the MBR.

trashbird1240 11-27-2006 04:53 AM

Dear Sir,

Thanks for getting back to me. I am really interested in using Slackware.

I did not install the slackware generate LILO to my MBR because my main system boots fine from the LILO -- are you saying I can add an entry for slackware to that lilo.conf and boot into slackware? Or do I have to install it from slackware and then add PCLinuxOS?

Thanks for the literature on initrd -- I did not set up an initrd.


Do I need to eradicate LILO on the slackware root partition?

I got the kernel panic after not installing LILO to /dev/sda7 initially, however my lilo.conf entries were screwed up then, too. Would this cause the kernel panic?

By the way, I've used google many times to look up this kernel panic and never found a single conclusive answer: if you're aware of an article that addresses it, please post a link to it -- I WOULD REALLY LIKE TO READ IT.

Thanks,
Joel
:newbie:

trashbird1240 11-27-2006 06:44 AM

Hello,

I've since updated my lilo.conf and learned a little about LILO. Here's the file:

Code:

# File generated by DrakX/drakboot
# WARNING: do not forget to run lilo after modifying this file

default="linux"
boot=/dev/sda
map=/boot/map
menu-scheme=wb:bw:wb:bw
prompt
nowarn
timeout=100
message=/boot/message
image=/boot/vmlinuz
        label="PCLinuxOS"
        root=/dev/sda1
        initrd=/boot/initrd.img
        append="acpi=ht splash=verbose"
        vga=788
image=/boot/vmlinuz
        label="PCLinuxOS-nonfb"
        root=/dev/sda1
        initrd=/boot/initrd.img
        append="acpi=ht splash=verbose"
image=/boot/vmlinuz
        label="PCLinuxOS-failsafe"
        root=/dev/sda1
        initrd=/boot/initrd.img
        append="failsafe"
image=/boot/vmlinuz-ide2.4.33.3
        label="slackware"
        root=/dev/sda7
        vga=788
        read-only

Then I run lilo:

Code:


[root@localhost joel]# lilo -v
LILO version 22.6.1, Copyright (C) 1992-1998 Werner Almesberger
Development beyond version 21 Copyright (C) 1999-2004 John Coffman
Released 17-Nov-2004, and compiled at 14:46:41 on Oct 11 2005

Reading boot sector from /dev/sda
Using GRAPHIC secondary loader
Calling map_insert_data
Mapping message file /boot/message -> message-graphic
Calling map_insert_file

Boot image: /boot/vmlinuz -> vmlinuz-2.6.16.27.tex1.lve
Mapping RAM disk /boot/initrd.img -> initrd-2.6.16.27.tex1.lve.img
Added PCLinuxOS

Boot image: /boot/vmlinuz -> vmlinuz-2.6.16.27.tex1.lve
Mapping RAM disk /boot/initrd.img -> initrd-2.6.16.27.tex1.lve.img
Added PCLinuxOS-nonfb

Boot image: /boot/vmlinuz -> vmlinuz-2.6.16.27.tex1.lve
Mapping RAM disk /boot/initrd.img -> initrd-2.6.16.27.tex1.lve.img
Added PCLinuxOS-failsafe

Boot image: /boot/vmlinuz-ide2.4.33.3
Fatal: open /boot/vmlinuz-ide2.4.33.3: No such file or directory


So, I figured out after rebooting with this configuration that it (presumably it=LILO) is loading the wrong kernel image -- I'm getting all the same stuff I would with the PCLinuxOS kernel.

Now the question is, how do I boot the sucker so that it recognizes the kernel image on /dev/sda7? The file is definitely there! What I mean is that when I look at /boot on /dev/sda7, /vmlinuz-ide2.4.33.3 is there; doesn't "root=/dev/sda7" tell LILO where to look?:scratch:

Thanks,
Joel

trashbird1240 11-27-2006 08:44 AM

Question: I notice that you have a line in your lilo.conf that says "panic=15" -- do I need this in my lilo.conf?

To clarify my original reply, I'm already using LILO -- it's already installed on the MBR and I'm configuring everything from within PCLinuxOS. The only systems installed on the computer are PCLinuxOS 0.93 and Slackware 11.0.

Thanks,
Joel

gnashley 11-27-2006 09:37 AM

Place a copy of your slackware kernel alongside the PC-linux kernel so that the PG-Linux lilo can find it.

trashbird1240 11-27-2006 10:26 AM

gnashley,

Do you mean in the /boot of my PCLinuxOS install on /dev/sda1?

I found this solution elsewhere on this forum and in others, and I believe it would work. Are there any other solutions? Is this just a matter of setting up LILO, i.e., the lilo command? Is there a lilo option that would convince the lilo command to look in /mnt/sda7/boot/vmlinuz?

Joel

trashbird1240 11-27-2006 11:19 AM

How about a symbolic link in my main /boot folder, for example

vmlinuz2 -> /mnt/sda7/boot/vmlinuz-ide2.4.33.3

Would that put LILO onto the scent?


Joel

Bruce Hill 11-27-2006 05:25 PM

You must have the proper names in /etc/lilo.conf.
Code:

mingdao@silas:~$ ls /boot | grep -i 2.4.33.3
System.map-ide-2.4.33.3
config-ide-2.4.33.3
vmlinuz-ide-2.4.33.3

Your error message says there is no /boot/vmlinuz-ide2.4.33.3:
Code:

Boot image: /boot/vmlinuz-ide2.4.33.3
Fatal: open /boot/vmlinuz-ide2.4.33.3: No such file or directory

and your /etc/lilo.conf has:
Code:

image=/boot/vmlinuz-ide2.4.33.3
        label="slackware"
        root=/dev/sda7
        vga=788
        read-only

Perhaps that is because you left a hyphen out of the image name?

When you try to boot Slackware, what happens?

Originally posted by trashbird1240:
Quote:

"Kernel panic -- not syncing -- no init found..."
At that point your system hangs, it will not accept even keyboard input,
so you must depress the Reset switch or turn the power off and reboot.

If you put
Code:

append="panic=15"
in /etc/lilo.conf, when you have a kernel panic your system will reboot
itself after 15 seconds. This gives me enough time to read the terminal
and determine why the kernel panic happened.

Don't symlink your kernel image, just set LiLO up correctly.

trashbird1240 11-27-2006 08:22 PM

Howdy Y'all

Thanks for all the help: I got it to work by copying the slackware kernel to the /boot directory while I run lilo.

That may have in fact been unnecessary since the error was not with the slackware entry, it was that I changed the name of the default entry without changing the name under the default field.

Joel

Bruce Hill 11-28-2006 12:51 AM

A classic case of PEBKAC. :D

trashbird1240 11-28-2006 08:43 AM

Ha! What is PEBKAC?

It's been working pretty good -- I'm just trying to configure X and add myself as a user and all that stuff.

It's a really nice system -- very UNIXy. I even logged in to Pine, just for old time's sake!

Joel

Bruce Hill 11-28-2006 08:06 PM

PEBKAC

Hang in there -- Slackware has given me back my Personal Computer that Mickey$oft took away. We Slackers in these forums will do whatever we can to help you.

trashbird1240 11-29-2006 08:49 AM

Thankfully I broke the Micro$*ft monopoly long ago in our house with PCLinuxOS. However, Slackware is quickly rising on my favorites list, and I may want to make it my main scientific platform.

I love Slackware so far; I was telling some people last night on IRC that I wish I could use it at work...

If you can get me out of that Broken Window then I'll be a Slacker for life ;)

When I get to grad school I'm setting up my own system, no ifs ands or buts (I think they'll be happy to hear that, actually). If anyone has any experience on this end, let me know.

Joel


All times are GMT -5. The time now is 05:23 AM.