(Solved) Kernel panic at boot from CD to install GRUB.

You have a problem with Salix? Post here and we'll do what we can to help.
Shador
Posts: 1295
Joined: 11. Jun 2009, 14:04
Location: Bavaria

Re: Kernel panic at boot from CD to install GRUB.

Post by Shador »

No, actually you're changing the order of the commands. This is the right order (small error regarding the pathes corrected, but this was not causing the troubles):

Code: Select all

mkdir /mnt/sdc1
mount /dev/sdc1 /mnt/sdc1
mount --bind /proc /mnt/sdc1/proc
mount --bind /sys /mnt/sdc1/sys
mount --bind /dev /mnt/sdc1/dev
chroot /mnt/sdc1
dhcpcd eth0  # <-- here and NOT BEFORE the CHROOT line
slapt-get -u
slapt-get -i grub2
grub-install /dev/sdc  # --boot-directory not needed here, because we've changed root to /mnt/sdc1 i.e. /mnt/sdc1/boot is now /boot
update-grub
Image
User avatar
globetrotterdk
Posts: 435
Joined: 26. Oct 2010, 13:57
Location: Denmark

Re: Kernel panic at boot from CD to install GRUB.

Post by globetrotterdk »

I get the following:

Code: Select all

# mkdir /mnt/sdc1
root[one]# mount /dev/sdc1 /mnt/sdc1
root[one]# mount --bind /proc /mnt/sdc1/proc
root[one]# mount --bind /sys /mnt/sdc1/sys
root[one]# mount --bind /dev /mnt/sdc1/dev
root[one]# chroot /mnt/sdc1
root[/]# dhcpcd eth0
dhcpcd[3172]: version 5.2.12 starting
dhcpcd[3172]: eth0: broadcasting for a lease
dhcpcd[3172]: timed out
dhcpcd[3172]: allowing 8 seconds for IPv4LL timeout
dhcpcd[3172]: eth0: probing for an IPv4LL address
dhcpcd[3172]: eth0: checking for 169.254.234.82
dhcpcd[3172]: eth0: using IPv4LL address 169.254.234.82
dhcpcd[3172]: forked to background, child pid 3199
root[/]# slapt-get -u
Retrieving package data [http://salix.enialis.net/i486/slackware-13.37/]...Failed to download: Couldn't resolve host name
Retrieving package data [http://salix.enialis.net/i486/slackware-13.37/extra/]...Failed to download: Couldn't resolve host name
Retrieving package data [http://salix.enialis.net/i486/13.37/]...Failed to download: Couldn't resolve host name
Sources failed to download, correct sources and rerun --update
Edit:
I also tried disconnecting from the Ethernet network in Wicd, and quitting Wicd. I then ran the following within the chroot:

Code: Select all

# ifconfig eth0 up
root[/]# dhcpcd eth0
dhcpcd[3285]: dhcpcd already running on pid 3184 (/var/run/dhcpcd-eth0.pid)
root[/]# slapt-get --update
Retrieving package data [http://salix.enialis.net/i486/slackware-13.37/]...Cached
Retrieving patch list [http://salix.enialis.net/i486/slackware-13.37/]...Cached
Retrieving checksum list [http://salix.enialis.net/i486/slackware-13.37/]...Cached
Retrieving checksum signature [http://salix.enialis.net/i486/slackware-13.37/]...Cached
Verifying checksum signature [http://salix.enialis.net/i486/slackware-13.37/]...Not Verified
Retrieving package data [http://salix.enialis.net/i486/slackware-13.37/extra/]...Cached
Retrieving patch list [http://salix.enialis.net/i486/slackware-13.37/extra/]... Done
Retrieving checksum list [http://salix.enialis.net/i486/slackware-13.37/extra/]...Cached
Retrieving checksum signature [http://salix.enialis.net/i486/slackware-13.37/extra/]...Cached
Verifying checksum signature [http://salix.enialis.net/i486/slackware-13.37/extra/]...Not Verified
Retrieving package data [http://salix.enialis.net/i486/13.37/]...Cached
Retrieving patch list [http://salix.enialis.net/i486/13.37/]...Done
Retrieving checksum list [http://salix.enialis.net/i486/13.37/]...Cached
Retrieving checksum signature [http://salix.enialis.net/i486/13.37/]...Cached
Verifying checksum signature [http://salix.enialis.net/i486/13.37/]...Not Verified
Sources failed to download, correct sources and rerun --update
root[/]# slapt-get -i grub2
Reading Package Lists...Failed to open package_data
package_data: No such file or directory
Perhaps you want to run --update?
Military justice is to justice what military music is to music. - Groucho Marx
User avatar
mimosa
Salix Warrior
Posts: 3311
Joined: 25. May 2010, 17:02
Contact:

Re: Kernel panic at boot from CD to install GRUB.

Post by mimosa »

I suggest trying the other tack and installing grub2 using spkg, as I described above. If there are no missing deps (and I incline to think there won't be) it should be more straightforward that way than trying to sort out what's going wrong with networking (or package management) inside the chroot. Just make sure you chroot before installing the package.

On the other hand, as a starting point for understanding what's amiss, it looks like you have the network (?), but the package database is going in the wrong place. Are you still inside the chroot there? Why is there cached data, when there was no data before?

I say again, I think it's easier to take the other tack.
Shador
Posts: 1295
Joined: 11. Jun 2009, 14:04
Location: Bavaria

Re: Kernel panic at boot from CD to install GRUB.

Post by Shador »

Yes, I agree with mimosa.

My only remaining guess is this:

Code: Select all

mkdir /mnt/sdc1
mount /dev/sdc1 /mnt/sdc1
mount --bind /proc /mnt/sdc1/proc
mount --bind /sys /mnt/sdc1/sys
mount --bind /dev /mnt/sdc1/dev
cp -L /etc/resolv.conf /mnt/sdc1/etc/resolv.conf
chroot /mnt/sdc1
slapt-get -u
slapt-get -i grub2
grub-install /dev/sdc  # --boot-directory not needed here, because we've changed root to /mnt/sdc1 i.e. /mnt/sdc1/boot is now /boot
update-grub
Image
User avatar
globetrotterdk
Posts: 435
Joined: 26. Oct 2010, 13:57
Location: Denmark

Re: Kernel panic at boot from CD to install GRUB.

Post by globetrotterdk »

Thanks for all of the help so far. I successfully installed grub by using mimosa's method. Now comes booting from the SD card, in the internal card reader on the EeePC 701. I can boot into Grub, however I get a kernel panic when Grub tries to boot into the system. I would have posted the relevant bits here, but I can't find them. The /boot/grub/grub.cfg fille is empty, and I haven't been able to find anything relevant in /etc/default/grub either
Military justice is to justice what military music is to music. - Groucho Marx
Shador
Posts: 1295
Joined: 11. Jun 2009, 14:04
Location: Bavaria

Re: Kernel panic at boot from CD to install GRUB.

Post by Shador »

globetrotterdk wrote:The /boot/grub/grub.cfg fille is empty,
Then you wouldn't even be able to boot a kernel. Are you sure you're looking in the right location? Maybe grub is looking somewhere else then you think?
globetrotterdk wrote:I successfully installed grub by using mimosa's method.
I hope you used chroot when running grub-mkconfig?
globetrotterdk wrote:I would have posted the relevant bits here, but I can't find them.
Still the message would be useful. I guess the kernel can't access its root. Did you generate an initrd as mentioned previously? Is that initrd loaded by grub? Are all needed modules included in that initrd?
Image
User avatar
globetrotterdk
Posts: 435
Joined: 26. Oct 2010, 13:57
Location: Denmark

Re: Kernel panic at boot from CD to install GRUB.

Post by globetrotterdk »

Shador wrote:
globetrotterdk wrote:The /boot/grub/grub.cfg fille is empty,
Then you wouldn't even be able to boot a kernel. Are you sure you're looking in the right location? Maybe grub is looking somewhere else then you think?
I have taken the SD card and placed it in an external card reader, connected to my desktop machine (Salix64-KDE). Maybe I am using the wrong program to view the file? I am using Kwrite.
Shador wrote:
globetrotterdk wrote:I successfully installed grub by using mimosa's method.
I hope you used chroot when running grub-mkconfig?
Here is what I did:

Code: Select all

root[one]# mkdir /mnt/sdc1
root[one]# mount /dev/sdc1 /mnt/sdc1
root[one]# mount --bind /proc /mnt/sdc1/proc
root[one]# mount --bind /sys /mnt/sdc1/sys
root[one]# mount --bind /dev /mnt/sdc1/dev
root[one]# chroot /mnt/sdc1
root[/]# ls -l
total 1736
drwxr-xr-x   2 root root    4096 Mar 22 23:46 bin
drwxr-xr-x   3 root root    4096 Mar 27 12:15 boot
drwxr-xr-x  16 root root    6160 Mar 28 17:21 dev
drwxr-xr-x  60 root root    4096 Mar 22 23:59 etc
-rw-r--r--   1 root root 1693132 Mar 28 17:17 grub2-1.99-i486-4ab.txz
drwxr-xr-x   2 root root    4096 Mar 22 23:40 home
drwxr-xr-x   6 root root    4096 Mar 22 23:55 lib
drwx------   2 root root   16384 Mar 22 23:38 lost+found
drwxr-xr-x  16 root root    4096 Mar 22 23:41 media
drwxr-xr-x  10 root root    4096 Mar 22 23:41 mnt
drwxr-xr-x   2 root root    4096 Jun 10  2007 opt
dr-xr-xr-x 153 root root       0 Mar 28 17:20 proc
drwx------   3 root root    4096 Mar 25 21:35 root
drwxr-xr-x   2 root root   12288 Mar 22 23:55 sbin
drwxr-xr-x   2 root root    4096 Apr  8  2007 srv
drwxr-xr-x  13 root root       0 Mar 28 17:20 sys
drwxrwxrwt   4 root root    4096 Mar 28 15:24 tmp
drwxr-xr-x  15 root root    4096 Mar 22 23:51 usr
drwxr-xr-x  14 root root    4096 Mar 22 23:46 var
root[/]# spkg -i grub2-1.99-i486-4ab.txz
Installing package grub2-1.99-i486-4ab...
| grub2 (the second GNU GRand Unified Bootloader)
| 
| GRUB 2 has been rewritten from scratch to clean up everything for
| modularity and portability.
| Features are: Scripting support, Graphical interface, Rescue mode,
| cross-platform and many more
| Briefly, boot loader is the first software program that runs when a
| computer starts. It is responsible for loading and transferring
| control to the operating system kernel software (such as the Hurd or
| the Linux). The kernel, in turn, initializes the rest of the operating
| system (e.g. GNU).
| 
| 
root[/]# grub-install /dev/sdc
Installation finished. No error reported.
root[/]# update-grub
Generating grub.cfg ...
Found background: /boot/grub/salix.jpg
Found linux image: /boot/vmlinuz-huge-smp-2.6.37.6-smp
done
Shador wrote:
globetrotterdk wrote:I would have posted the relevant bits here, but I can't find them.
Still the message would be useful. I guess the kernel can't access its root. Did you generate an initrd as mentioned previously? Is that initrd loaded by grub? Are all needed modules included in that initrd?
That is of course a good question. I believe so. What I am sure of is that Grub needs to be reconfigured for the EeePC. Here are some bits I m copying from the boot screen:

Code: Select all

---snip---
insmod part_msdos
insmod ext2
set root='(hd1,msdos1)'
---snip---
linux /boot/vmlinuz-huge-smp-2.6.37.6-smp root=/dev/sdc1 ro vt.default_utf8=1 quiet
The SD card is definately no longer /dev/sdc1as the EeePC only has an internal HD og an internal card reader connected. Both / and /home partitions on the SD card are formatted as ext4, not ext2. Lastly, I am not sure if the uuid is correct. Grub is installed on the SD card, so if the uuid refers to that, it would be correct, otherwise not.
Military justice is to justice what military music is to music. - Groucho Marx
Shador
Posts: 1295
Joined: 11. Jun 2009, 14:04
Location: Bavaria

Re: Kernel panic at boot from CD to install GRUB.

Post by Shador »

globetrotterdk wrote:

Code: Select all

Generating grub.cfg ...
Found background: /boot/grub/salix.jpg
Found linux image: /boot/vmlinuz-huge-smp-2.6.37.6-smp
done
So you didn't generate an initrd! That's what our initial discussion was all about!
globetrotterdk wrote:I have taken the SD card and placed it in an external card reader, connected to my desktop machine (Salix64-KDE). Maybe I am using the wrong program to view the file? I am using Kwrite.
No idea. You're looking obviously in a different location than grub2.
globetrotterdk wrote:That is of course a good question. I believe so. What I am sure of is that Grub needs to be reconfigured for the EeePC. Here are some bits I m copying from the boot screen:

Code: Select all

---snip---
insmod part_msdos
insmod ext2
set root='(hd1,msdos1)'
---snip---
linux /boot/vmlinuz-huge-smp-2.6.37.6-smp root=/dev/sdc1 ro vt.default_utf8=1 quiet
No, the configuration is fine. UUIDs take precedence for locating the kernel image.
globetrotterdk wrote:

Code: Select all

linux /boot/vmlinuz-huge-smp-2.6.37.6-smp root=/dev/sdc1 ro vt.default_utf8=1 quiet
That's not fine. You need to generate an initrd using mkinitrd with the -u option additionally (don't forget the modules for your card reader, ...). Additionally you need to change /etc/fstab to use UUID= for all devices. After you generated the initrd, run update-grub on the sd card again (using chroot). This should add a initrd /boot/... line and change the kernel argument to root=UUID=...
globetrotterdk wrote:Both / and /home partitions on the SD card are formatted as ext4, not ext2.
That's fine. There is only an ext2 module with grub2 which offers read support for ext2/3/4.
globetrotterdk wrote:Lastly, I am not sure if the uuid is correct.
So? Nothing I can do about that. You can check that using blkid. But if you called update-grub properly, I'm certain it's right.
Image
User avatar
globetrotterdk
Posts: 435
Joined: 26. Oct 2010, 13:57
Location: Denmark

Re: Kernel panic at boot from CD to install GRUB.

Post by globetrotterdk »

Shador wrote:
globetrotterdk wrote:

Code: Select all

Generating grub.cfg ...
Found background: /boot/grub/salix.jpg
Found linux image: /boot/vmlinuz-huge-smp-2.6.37.6-smp
done
So you didn't generate an initrd! That's what our initial discussion was all about!
I have since tried the following:

Code: Select all

root[one]# mkdir /mnt/sdc1
root[one]# mount /dev/sdc1 /mnt/sdc1
root[one]# mount --bind /proc /mnt/sdc1/proc
root[one]# mount --bind /sys /mnt/sdc1/sys
root[one]# mount --bind /dev /mnt/sdc1/dev
root[one]# chroot /mnt/sdc1
root[/]# mkinitrd -u usb-storage
10464 blocks
/boot/initrd.gz created.
Be sure to run lilo again if you use it.
root[/]# update-grub
Generating grub.cfg ...
Found background: /boot/grub/salix.jpg
Found linux image: /boot/vmlinuz-huge-smp-2.6.37.6-smp
done
Unfortunately, the boot still results in a kernel panic, even when I edit the Grub boot parameters (hd1 to hd0, /dev/sdc1 to /dev/sdb1 and /dev/sda1. I have tried to do some research on the hardware, but the main source for information was Eee User, which seems to no longer be available.
Shador wrote:
globetrotterdk wrote:I have taken the SD card and
placed it in an external card reader, connected to my desktop machine
(Salix64-KDE). Maybe I am using the wrong program to view the file? I
am using Kwrite.
No idea. You're looking obviously in a different location than grub2.
Hmm. Neither /boot/grub.cfg, /etc/default/grub, or the contents of/etc/grub.d contain anything that looks like the Grub boot parameters at startup. Those seem to be the main places to look.
Military justice is to justice what military music is to music. - Groucho Marx
Shador
Posts: 1295
Joined: 11. Jun 2009, 14:04
Location: Bavaria

Re: Kernel panic at boot from CD to install GRUB.

Post by Shador »

globetrotterdk wrote:mkinitrd -u usb-storage
That's wrong syntax. Did you even consult the mkinird man page? I suggest something like this:

Code: Select all

mkinird -c -u -m usb-storage
But you need probably more than usb-storage. If you post the output of lsmod from the machine with the card reader attached, I might be able to give some hints. Also add the output of lspci -k.
globetrotterdk wrote:Unfortunately, the boot still results in a kernel panic, even when I edit the Grub boot parameters (hd1 to hd0, /dev/sdc1 to /dev/sdb1 and /dev/sda1.
No use in that. Unless the UUID search fails for some reason, it's overwritten by the result of the UUID search. So effectively that value is never used.
Shador wrote:Additionally you need to change /etc/fstab to use UUID= for all devices.
Did you change this? Although this doesn't cause a kernel panic, it could cause troubles later.
Shador wrote:This should add a initrd /boot/... line and change the kernel argument to root=UUID=...
Did you check the grub.cfg for this?
Image
Post Reply