You are not logged in.

#1 2009-11-27 17:56:03

xeddog
Member
Registered: 2009-11-25
Posts: 9

[Solved] Arch Kernel Panic with Grub2

I have an older Pentium-4 machine with Ubuntu Jaunty installed on sda and Arch on sdb.  Both disk drives are IDE (PATA?).   In another post I was having difficultly getting Arch into my grub2 menu so I was unable to boot Arch at all.  I got grub2 working to the point where Arch starts to boot, but I get a kernel panic.  Here is the last of the screen information.  I had to type all this manually, but I think it is 100% correct.

I **think** all is good until:
.
::Initramfs Completed -  control passing to kinit
IP-Config: - No devices to configure
Waiting 0 s before mounting root device...
kinit:  Mounted root (ext2 filesystem) readonly.
kinit:  init not found!
Kernel Panic - not syncing:Attempting to kill init!
Pid: 1, comm: kinit not tainted 2.6.31-ARCH #1
Call Trace:

then a few lines of the trace info.

This message says ext2 for root but for this particular install, root was supposed to be ext3.  I booted Jaunty and "sudo fdisk -l"showed sdb3 and sdb4 as ext3.  I am not sure if that is significant since, as I understand it, ext3 is backwards compatible with ext2.

My Arch drive is currently partitioned thusly:
sda1     /boot      ext2
sdb2 - swap   
sdb3     /            currently ext4
sdb4     /home    currently ext4
(for sdb3 and sdb4 I have tried using ext2, ext3, and ext4.  Same results every time.)

I have been working on this quite a bit, but for the last install I used ext4 and when I use grub to to attempt to boot Arch I still get the above kernel panic.  If I disconnect drive sda, and let the computer boot grub legacy that is installed on sdb, then I can successfully boot Arch.

So the question is, how do I successfully boot Arch using grub2?  I have been working on this for 2 or 3 days now and I have tried all kinds of configurations in grub2 with no success.  SOMEbody must have the magic key.

Thanks in advance,

xeddog

Last edited by xeddog (2009-11-29 19:22:03)

Offline

#2 2009-11-28 07:48:31

rockin turtle
Member
From: Montana, USA
Registered: 2009-10-22
Posts: 227

Re: [Solved] Arch Kernel Panic with Grub2

I've never used grub2 so this may be incorrect; however, I think the

      kinit:  Mounted root (ext2 filesystem) readonly.
      kinit:  init not found!

lines are significant.  To me, these imply that grub2 is looking on some ext2 partition for "/" and can't find it  In other words, it may mount some partition such as /dev/sdb1 expecting it to be "/".  The kernel then tries to run the "init" process, but cannot find it.  "init" should be in the /sbin directory on your /dev/sdb3 partition.  The fact that you are able to boot into arch using the legacy grub implies to me that you have a valid "init" on /dev/sdb3.

It may be helpful to see your grub.cfg (for grub2) file - it should contain an entry something like:

     # Entry 1 - Load Arch Linux kernel
     menuentry "Arch Linux" {
         set root=(hd1,1)
         linux /vmlinuz root=/dev/sdb3
         initrd /initrd
     }

set root=(hd1,1)                              tells grub2 to boot from the first partition on disk 1, which in your case would be /dev/sdb1.
linux /vmlinuz root=/dev/sdb3     tells grub2 that the file "/vmlinuz" on /dev/sdb1 is the kernel and that /dev/sdb3 is where "/" can be found

One final thought (you perhaps are already familiar with this), instead of using root=/dev/sdb3, you could use the "by-uuid" method of identifing your root partition.  Look in the /dev/disk/by-uuid directory.  This directory should contain a "file" for each of your mounted partitions.   These "files" have long rather strange names.  Find the file associated with /dev/sdb3 by typing "ls -l /dev/disk/by-uuid" at a bash prompt (don't type the quotes).  You should see a line something like this:

     1551e3ba-2c57-4d61-8639-784b4fe0348d -> ../../sdb3

(Your partition would have a different name, of course.)  Then edit your grub.cfg file to contain the line (use your uuid name):

     linux /vmlinuz root=/dev/disk/by-uuid/1551e3ba-2c57-4d61-8639-784b4fe0348d

instead of

     linux /vmlinuz root=/dev/sdb3

The advantage to doing it this way would be that if you ever added a new disk to your system, the system might identify that new disk as /dev/sdb during boot.  If your grub.cfg file uses "root=/dev/sdb3" then you would have problems booting.  Using the "by-uuid" method would result in a successful boot.  In fact, when you disconnect your /dev/sda drive to boot into "arch" now, you should see your "arch" partitions show up as /dev/sdaX (type "df" at a bash prompt to see) instead of /dev/sdbX.

Offline

#3 2009-11-28 18:43:13

xeddog
Member
Registered: 2009-11-25
Posts: 9

Re: [Solved] Arch Kernel Panic with Grub2

Thanks for the reply turtle -

I think the problem is, as you suggest, that /boot and / are different partitions, and that this is a problem with grub2.  I say that because I have found a workaround to this problem.  If I go into my machine bios and change the disk boot order so that the machine boots from sdb, the machine will load grub (legacy) and I can boot Arch from there.  For now, I have to go back to the machine bios and change the disk order back to boot Ubuntu.  I COULD probably just add Ubuntu Jaunty to this grub, but since a lot of new distros either are or will be defaulting to Grub2, I would like to get it working.

So back to grub2.   I have tried a couple of things to try and resolve this but nothing has worked yet.  Listed below are just a couple of the entries in /etc/grub.d/40_custom that I have tried (this is where you define your own menu entries in grub2):

menuentry "Arch Linux (hd1,1) sdb1-1"  {
    insmod ext2
    set root=(hd1,1)
    linux /vmlinuz26 root=/dev/sdb1  ro 
    initrd /kernel26.img
}

Or

menuentry "Arch Linux (hd1,1)"  {
    insmod ext2
    set root=(hd1,1)
    search --no-floppy --fs-uuid --set 8dc03f62-7dfa-4900-84c7-610c1817e688
    linux /vmlinuz26 root=/dev/disk/by-uuid/8dc03f62-7dfa-4900-84c7-610c1817e688  ro 
    initrd /kernel26.img
}

Note:  I obtained the UUID from the output of boot_info_script036.sh

I have tried a LOT of things in the grub2 menu.  Among the things that I have tried modifying, either individually or in combination, in the two above samples are:

1.  I have left out the "insmod ext2" line.
2.  I have tried changing "insmod ext2" to "insmod ext3".
3.  I have only used the "search" line when specifying UUIDs, but I have tried leaving it out.
4.  I have massaged the set root= drive and partition numbers.  Mostly to (hd1,3) but tried a couple of others too.
5.  I have changed the "linux /vmlinuz26" to "linux /boot/vmlinuz26".  This is mostly when trying to boot from /dev/sdb3.
6.  I have changed the "initrd /kernel26.img" to read "initrd /boot/kernel26.img"  Also mostly when trying to boot from /dev/sdb3.
7.  I'm sure I have tried a few other things too. 

Many of the things I tried I didn't expect to work, but when you have been fighting this for two days you start to try anything. 

One last thing of possible interest.  When I boot Ubuntu and run "update-grub2" in a terminal, the last line of output from the command says "Found Arch on /dev/sdb3".    sdb3???  I wonder what the update-grub2 command is looking for?  The Arch kernel is definitely on /dev/sdb1.

Thanks again.

xeddog

Offline

#4 2009-11-28 19:34:41

qb1base
Member
Registered: 2009-07-30
Posts: 15

Re: [Solved] Arch Kernel Panic with Grub2

Your 40_custom rule is still wrong.

Offline

#5 2009-11-28 20:44:49

tavianator
Member
From: Waterloo, ON, Canada
Registered: 2007-08-21
Posts: 858
Website

Re: [Solved] Arch Kernel Panic with Grub2

Specifically, the one line should read "linux /vmlinuz26 root=/dev/sdb3  ro" (not sdb1).

Offline

#6 2009-11-28 22:17:29

xeddog
Member
Registered: 2009-11-25
Posts: 9

Re: [Solved] Arch Kernel Panic with Grub2

to tavianator - That is just one of the many things that I have tried.  When I change to root=(hd1,3) and /dev/sdb3, grub2 gives me an error saying that I need to load the kernel first.  (going from memory here, but I am about 99% sure that is what happens.)  I have tried all combinations of root=(hd1,0),  root=(hd1,1), root=(hd1,3), along with /dev/sdb1 and /dev/sdb3.  For any combination that starts to boot I get a kernel panic.  For all others I get a grub2 message that I need to load the kernel first.


To qb1base - Please provide specifics

To everyone - My workaround to boot Arch doesn't quite work the way I said.  In order for me to boot Arch, I must physically disconnect the other disk.

Thanks,

xeddog

Offline

#7 2009-11-28 22:55:06

tavianator
Member
From: Waterloo, ON, Canada
Registered: 2007-08-21
Posts: 858
Website

Re: [Solved] Arch Kernel Panic with Grub2

xeddog:  The root= grub parameter tells grub where to find the kernel; this should be /boot if you have a boot partition.  Check your /boot/grub/device.map, but judging by your setup it should probably be (hd0,0).  The root= kernel parameter should tell the kernel where to find the / partition, so /dev/sdb3 is appropriate.

Offline

#8 2009-11-28 23:48:27

qb1base
Member
Registered: 2009-07-30
Posts: 15

Re: [Solved] Arch Kernel Panic with Grub2

Alright, you have /boot at sdb1 correct? You've posted that your core.img is at sdb1 correct? Now assuming that your uuid is correct for sdb1, and that is where your core.img is, what do you have to change? Come on, make it your Beeotch!

Offline

#9 2009-11-29 01:52:10

xeddog
Member
Registered: 2009-11-25
Posts: 9

Re: [Solved] Arch Kernel Panic with Grub2

OK, maybe a litle more "progress to the rear".  Using the 40_custom entry of:

menuentry "Arch Linux (hd1,1)"  {
    insmod ext2
    set root=(hd1,1)
    search --no-floppy --fs-uuid --set 8dc03f62-7dfa-4900-84c7-610c1817e688
    linux /vmlinuz26 root=/dev/disk/by-uuid/8dc03f62-7dfa-4900-84c7-610c1817e688  ro 
    initrd /kernel26.img
}

It sounds like yooz guys are right because "set root=(hd1,1)" points to the /boot partition and the UUID information in the following lines points to the / partition on /dev/sdb3 and the Arch boot is getting further along.  Good thing I'm not a betting man because I would have bet a whole weeks pay that I have tried this combination and it panic'd.  I guess a weeks pay wouldn't really amount to much since I don't get a paycheck any more.  lol

But!!!

Now it looks like Arch is trying to boot and it is getting further along.  I see filesystems mounted and then I get a superblock error on /dev/sdA3.  Now why sda3 I don't know since that partition doesn't even exist.  At least for now I have something else to look into. 


Thanks for your help.  I'll probably be back soon with another question.   sad
xeddog

Offline

#10 2009-11-29 02:38:27

qb1base
Member
Registered: 2009-07-30
Posts: 15

Re: [Solved] Arch Kernel Panic with Grub2

Code:

menuentry "Arch Linux (hd1,1)"  {
    insmod ext2
    set root=(hd1,1)
    search --no-floppy --fs-uuid --set "uuid of your /sdb1"
    linux /boot/vmlinuz26 root=/dev/disk/by-uuid/"uuid of your /sdb1"  ro
    initrd /boot/kernel26.img
}
If that doesn't work, your arch kernel isn't where we think it is.

Offline

#11 2009-11-29 04:55:26

rockin turtle
Member
From: Montana, USA
Registered: 2009-10-22
Posts: 227

Re: [Solved] Arch Kernel Panic with Grub2

Now it looks like Arch is trying to boot and it is getting further along.  I see filesystems mounted and then I get a superblock error on /dev/sdA3.  Now why sda3 I don't know since that partition doesn't even exist.  At least for now I have something else to look into.

It is very likely that when you boot Arch, the disk names get reversed.  In other words

from Unbuntu you see:
         unbuntu    /dev/sda
         arch           /dev/sdb

and from arch you see:
         unbuntu    /dev/sdb
         arch           /dev/sda

That is because the names "sda" and "sdb" are determined and assigned as part of the boot process.   In fact, this is why the by-uuid method was developed - so you could deterministically identify your disk.

I don't know why you are getting a superblock error.  I had a similar problem to you a month ago when I set up a pentium 4 system.  You can follow what I went through then here: http://bbs.archlinux.org/viewtopic.php?id=81676

The thread was started by someone else who was having a problem similar to mine.  I got off track a few times so you have to read to the end to see how I finally resolved it.

Last edited by rockin turtle (2009-11-29 05:14:48)

Offline

#12 2009-11-29 06:57:44

tavianator
Member
From: Waterloo, ON, Canada
Registered: 2007-08-21
Posts: 858
Website

Re: [Solved] Arch Kernel Panic with Grub2

Superblock error is likely a result of trying to mount the wrong filesystem.  Post your /etc/fstab.

Offline

#13 2009-11-29 17:25:41

xeddog
Member
Registered: 2009-11-25
Posts: 9

Re: [Solved] Arch Kernel Panic with Grub2

WOOHOO!!!

I finally have Arch booting properly.  Dang.  About time, huh?

The final piece was to edit the fstab for Arch and change all of the drive designations from /dev/sdax to /sev/sdbx. 

I read a lot of stuff about the problems I was having and a lot of them seem to revolve around the 2009.8 images.  In any event, I learned a whole lot about linux.  I still don't quite understand why grub2 was having problems with Arch, but that is a topic for another forum on another day.  For now, I think I will see what else I can break in Arch.  :-)

Now.  If I can just figure out how to mark this thread as solved . . . . . . .


Thanks again.

xeddog

Last edited by xeddog (2009-11-29 17:27:18)

Offline

#14 2009-11-29 18:45:03

tavianator
Member
From: Waterloo, ON, Canada
Registered: 2007-08-21
Posts: 858
Website

Re: [Solved] Arch Kernel Panic with Grub2

Glad you got it working.  Edit the first post to mark it as solved.

Offline

#15 2010-06-28 01:59:53

yvonney
Member
Registered: 2008-06-11
Posts: 671

Re: [Solved] Arch Kernel Panic with Grub2

I know this is mark [SOLVED] hope it's OK to add.
The BIG one for me was adding usb and usbinput AFTER udev in /etc/mkinitcpio
and the the BIG BIG one was to rerun the /sbin/mkinitcpio etc. command so that the usb hooks get embedded.

Offline

Board footer

Powered by FluxBB